diff options
author | Florian Dold <florian.dold@gmail.com> | 2017-05-30 14:38:29 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2017-05-30 14:38:29 +0200 |
commit | 29908d5ef687c53153bde17856e4d8103bc0ad7b (patch) | |
tree | e0bb41c0d7283f2ef497dfaffd2656fbfe501b49 /webpack.config.js | |
parent | b1f0d6ac523af08ed4d8521b19aee4ce6c173b49 (diff) |
paths, multi env and webpack config
Diffstat (limited to 'webpack.config.js')
-rw-r--r-- | webpack.config.js | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/webpack.config.js b/webpack.config.js index d86379d57..cc17ad4de 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -3,6 +3,14 @@ const webpack = require('webpack'); const merge = require('webpack-merge'); +function externalsCb(context, request, callback) { + if (/.*taler-emscripten-lib.*/.test(request)) { + callback(null, "undefined"); + return; + } + callback(); +} + module.exports = function (env) { env = env || {}; const base = { @@ -28,7 +36,10 @@ module.exports = function (env) { }, plugins: [], devtool: "source-map", - externals: ["fs", "path", "child_process", /.*taler-emscripten-lib.*/], + externals: [ + externalsCb, + "child_process", + ], } if (env.prod) { base.plugins.push(new webpack.optimize.UglifyJsPlugin()); |