From 2c5d32c0117f200b188599d39926e8bfeafe9995 Mon Sep 17 00:00:00 2001 From: daurnimator Date: Wed, 17 May 2017 13:26:50 +1000 Subject: webpack.config.js: Mark crypto as external Optional dependency of seedrandom. This makes the web bundle *much* smaller --- webpack.config.js | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'webpack.config.js') diff --git a/webpack.config.js b/webpack.config.js index 21bc8c4..c54580e 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -10,6 +10,9 @@ module.exports = [ filename: 'fengari.js', library: 'fengari' }, + externals: { + "crypto": "crypto" + }, plugins: [ new webpack.DefinePlugin({ WEB: JSON.stringify(true), @@ -23,6 +26,9 @@ module.exports = [ filename: 'fengari.min.js', library: 'fengari' }, + externals: { + "crypto": "crypto" + }, plugins: [ new BabiliPlugin(), new webpack.DefinePlugin({ -- cgit v1.2.3-54-g00ecf From d8beee5d96f2e24f011314cc7711843df72d6e7e Mon Sep 17 00:00:00 2001 From: daurnimator Date: Wed, 17 May 2017 14:33:24 +1000 Subject: webpack.config.js: Add explicit target --- webpack.config.js | 2 ++ 1 file changed, 2 insertions(+) (limited to 'webpack.config.js') diff --git a/webpack.config.js b/webpack.config.js index c54580e..a776a44 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -5,6 +5,7 @@ const BabiliPlugin = require("babili-webpack-plugin"); module.exports = [ { entry: './src/fengari.js', + target: 'web', output: { path: path.resolve(__dirname, 'dist'), filename: 'fengari.js', @@ -21,6 +22,7 @@ module.exports = [ }, { entry: './src/fengari.js', + target: 'web', output: { path: path.resolve(__dirname, 'dist'), filename: 'fengari.min.js', -- cgit v1.2.3-54-g00ecf From dee3ae88feee44f07481d97d1acc6cd7607668b7 Mon Sep 17 00:00:00 2001 From: daurnimator Date: Wed, 17 May 2017 14:34:12 +1000 Subject: webpack.config.js: Babili should run *after* define --- webpack.config.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'webpack.config.js') diff --git a/webpack.config.js b/webpack.config.js index a776a44..7fbcf86 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -32,10 +32,10 @@ module.exports = [ "crypto": "crypto" }, plugins: [ - new BabiliPlugin(), new webpack.DefinePlugin({ WEB: JSON.stringify(true), - }) + }), + new BabiliPlugin() ] } ]; -- cgit v1.2.3-54-g00ecf