Skip to content

Commit 510de0f

Browse files
moonglumFND
authored andcommitted
switched to ESM as default format
NB: this constitutes a breaking change
1 parent a27f151 commit 510de0f

File tree

18 files changed

+36
-75
lines changed

18 files changed

+36
-75
lines changed

lib/bundle/config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ module.exports = generateConfig;
2626
// * `externals` determines which modules/packages to exclude from the bundle
2727
// (e.g. `{ jquery: "jQuery" }` - the key refers to the respective
2828
// module/package name, the value refers to a corresponding global variable)
29-
// * `format` determines the bundle format: ES, UMD, AMD, CommonJS or IIFE
30-
// (case-insensitive, defaults to IIFE)
29+
// * `format` determines the bundle format: ESM, UMD, AMD, CommonJS or IIFE
30+
// (case-insensitive, defaults to ESM)
3131
// * `exports` determines the bundle's API, as per the entry point's exported
3232
// value (if any)
3333
// * `esnext`, if truthy, activates ESNext transpilation
@@ -137,7 +137,7 @@ function generateConfig({ extensions = [], // eslint-disable-next-line indent
137137
});
138138
}
139139

140-
function determineModuleFormat(format = "iife") {
140+
function determineModuleFormat(format = "esm") {
141141
format = format.toLowerCase();
142142
let _format = MODULE_FORMATS[format];
143143
switch(_format) {

test/cli/test_basic/faucet.config.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ let path = require("path");
55
module.exports = {
66
js: [{
77
source: "./src/index.js",
8-
target: "./dist/bundle.js",
9-
format: "esm"
8+
target: "./dist/bundle.js"
109
}],
1110
plugins: [path.resolve(__dirname, "../../..")]
1211
};

test/cli/test_browserslist/faucet.config.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,16 @@ module.exports = {
66
js: [{
77
source: "./src/index.js",
88
target: "./dist/bundle.js",
9-
format: "esm",
109
esnext: true
1110
}, {
1211
source: "./src/index.js",
1312
target: "./dist/bundle_alt.js",
14-
format: "esm",
1513
esnext: {
1614
browserslist: false
1715
}
1816
}, {
1917
source: "./src/index.js",
2018
target: "./dist/bundle_legacy.js",
21-
format: "esm",
2219
esnext: {
2320
browserslist: "legacy"
2421
}

test/cli/test_bundle_customization/faucet.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ module.exports = {
1111
}, {
1212
source: "./src/index.js",
1313
target: "./dist/bundle_iife.js",
14+
format: "iife",
1415
exports: "MYLIB"
1516
}, {
1617
source: "./src/index.js",

test/cli/test_compact/faucet.config.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ let path = require("path");
55
module.exports = {
66
js: [{
77
source: "./src/index.js",
8-
target: "./dist/bundle.js",
9-
format: "esm"
8+
target: "./dist/bundle.js"
109
}],
1110
plugins: [path.resolve(__dirname, "../../..")]
1211
};

test/cli/test_custom_config/assets.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ let path = require("path");
55
module.exports = {
66
js: [{
77
source: "./index.js",
8-
target: "./dist/bundle.js",
9-
format: "esm"
8+
target: "./dist/bundle.js"
109
}],
1110
plugins: [path.resolve(__dirname, "../../..")]
1211
};

test/cli/test_fingerprinting/faucet.config.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,10 @@ let path = require("path");
55
module.exports = {
66
js: [{
77
source: "./src/index.js",
8-
target: "./dist/bundle.js",
9-
format: "esm"
8+
target: "./dist/bundle.js"
109
}, {
1110
source: "./src/index.js",
1211
target: "./dist/bundle_alt.js",
13-
format: "esm",
1412
fingerprint: false
1513
}],
1614
plugins: [path.resolve(__dirname, "../../..")]

test/cli/test_jsx/faucet.config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ module.exports = {
66
js: [{
77
source: "./src/index.jsx",
88
target: "./dist/bundle.js",
9-
format: "esm",
109
esnext: true,
1110
jsx: {
1211
pragma: "createElement",

test/cli/test_mangle/faucet.config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ module.exports = {
66
js: [{
77
source: "./src/index.js",
88
target: "./dist/bundle.js",
9-
format: "esm",
109
compact: "mangle"
1110
}],
1211
plugins: [path.resolve(__dirname, "../../..")]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"dist/bundle.js":"/assets/dist/bundle-7a1db6adc4ef815c9557d95c82779a74.js"}
1+
{"dist/bundle.js":"/assets/dist/bundle-68b329da9893e34099c7d8ad5cb9c940.js"}

0 commit comments

Comments
 (0)