Skip to content

Commit 6c05b40

Browse files
committed
fix: downgrade rollup to fix ES module bundling
1 parent 4b4f9a6 commit 6c05b40

File tree

4 files changed

+151
-23
lines changed

4 files changed

+151
-23
lines changed

karma.conf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ module.exports = function karmaConfig(config) {
8181
},
8282
electron: {
8383
base: 'Electron',
84-
flags: ['--show'],
84+
// flags: ['--show'],
8585
},
8686
},
8787
browsers: process.env.CI ? [

package-lock.json

Lines changed: 141 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
"fs-jetpack": "^1.2.0",
6767
"gh-pages": "^1.2.0",
6868
"gulp": "^3.9.1",
69-
"gulp-better-rollup": "^3.3.0",
69+
"gulp-better-rollup": "3.1.0",
7070
"gulp-rename": "^1.3.0",
7171
"gulp-replace": "^0.6.1",
7272
"gulp-rollup": "^2.16.2",
@@ -86,7 +86,7 @@
8686
"mocha": "^5.2.0",
8787
"nyc": "^12.0.2",
8888
"opn-cli": "^3.1.0",
89-
"rollup": "^0.62.0",
89+
"rollup": "^0.57.0",
9090
"rollup-plugin-alias": "^1.4.0",
9191
"rollup-plugin-commonjs": "^9.1.3",
9292
"rollup-plugin-node-builtins": "^2.1.2",

rollup.config.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,21 +40,26 @@ const namedExports = {
4040

4141
const plugins = [
4242
alias(adapters),
43-
builtins(),
4443
nodeResolve({
4544
browser: true,
45+
preferBuiltins: true,
4646
}),
4747
commonjs({
4848
include: 'node_modules/**',
4949
namedExports: namedExports,
5050
}),
51-
globals(),
5251
replace({
5352
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV),
5453
'process.env.TEST_ENV': JSON.stringify(process.env.TEST_ENV),
5554
}),
5655
];
5756

57+
// We use Node style testing so the Karma bundle needs some Node globals
58+
if (process.env.TEST_ENV) {
59+
plugins.push(builtins());
60+
plugins.push(globals());
61+
}
62+
5863
module.exports = {
5964
input: 'build/module/index.js',
6065
onwarn: function(warning) {

0 commit comments

Comments
 (0)