Permalink
Browse files

Step 1.4: Updated webpack config file

  • Loading branch information...
dotansimha authored and darkbasic committed Jan 24, 2017
1 parent a29329d commit 51679eb66f47d0b3b1e1aa0752f4299fe09e7106
Showing with 28 additions and 2 deletions.
  1. +28 −2 webpack.config.js
View
@@ -14,9 +14,16 @@ module.exports = {
resolve: {
extensions: ['.ts', '.js', '.json'],
modules: [path.resolve('node_modules')]
modules: [path.resolve('node_modules')],
alias: {
'api': path.resolve(__dirname, 'api/server')
}
},
externals: [
resolveExternals
],
module: {
loaders: [
{
@@ -36,13 +43,32 @@ module.exports = {
plugins: [
ionicWebpackFactory.getIonicEnvironmentPlugin(),
new webpack.ProvidePlugin({
__extends: 'typescript-extends'
})
],
// Some libraries import Node modules but don't use them in the browser.
// Tell Webpack to provide empty mocks for them so importing them works.
node: {
fs: 'empty',
net: 'empty',
tls: 'empty'
tls: 'empty',
__dirname: true
}
};
function resolveExternals(context, request, callback) {
return resolveMeteor(request, callback) ||
callback();
}
function resolveMeteor(request, callback) {
var match = request.match(/^meteor\/(.+)$/);
var pack = match && match[1];
if (pack) {
callback(null, 'Package["' + pack + '"]');
return true;
}
}

0 comments on commit 51679eb

Please sign in to comment.