aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Mateusz BurzyƄski <mateuszburzynski@gmail.com> 2022-01-05 11:37:25 +0100
committerGravatar GitHub <noreply@github.com> 2022-01-05 02:37:25 -0800
commite852bc098002e658818ac4b1ecf877b86d0ccea8 (patch)
tree799d2b4cb5f04dba1e13f15fad03349617594858
parent8a9b1416ed64d28ae4852e3e05a3c16d02a72ca5 (diff)
downloadbun-e852bc098002e658818ac4b1ecf877b86d0ccea8.tar.gz
bun-e852bc098002e658818ac4b1ecf877b86d0ccea8.tar.zst
bun-e852bc098002e658818ac4b1ecf877b86d0ccea8.zip
Drop redundant comments (#103)
-rw-r--r--src/options.zig23
1 files changed, 0 insertions, 23 deletions
diff --git a/src/options.zig b/src/options.zig
index 6864d0b20..c19d29c33 100644
--- a/src/options.zig
+++ b/src/options.zig
@@ -520,31 +520,8 @@ pub const Platform = enum {
pub const DefaultConditions: std.EnumArray(Platform, []const string) = brk: {
var array = std.EnumArray(Platform, []const string).initUndefined();
- // Note that this means if a package specifies "module" and "main", the ES6
- // module will not be selected. This means tree shaking will not work when
- // targeting node environments.
- //
- // This is unfortunately necessary for compatibility. Some packages
- // incorrectly treat the "module" field as "code for the browser". It
- // actually means "code for ES6 environments" which includes both node
- // and the browser.
- //
- // For example, the package "@firebase/app" prints a warning on startup about
- // the bundler incorrectly using code meant for the browser if the bundler
- // selects the "module" field instead of the "main" field.
- //
- // If you want to enable tree shaking when targeting node, you will have to
- // configure the main fields to be "module" and then "main". Keep in mind
- // that some packages may break if you do this.
array.set(Platform.node, &[_]string{default_conditions_strings.node});
- // Note that this means if a package specifies "main", "module", and
- // "browser" then "browser" will win out over "module". This is the
- // same behavior as webpack: https://github.com/webpack/webpack/issues/4674.
- //
- // This is deliberate because the presence of the "browser" field is a
- // good signal that the "module" field may have non-browser stuff in it,
- // which will crash or fail to be bundled when targeting the browser.
var listc = [_]string{
default_conditions_strings.browser,
default_conditions_strings.module,