From 29908d5ef687c53153bde17856e4d8103bc0ad7b Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Tue, 30 May 2017 14:38:29 +0200 Subject: paths, multi env and webpack config --- webpack.config.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'webpack.config.js') 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()); -- cgit v1.2.3