Permalink
Browse files

Step 1.3: Updated webpack config file

  • Loading branch information...
dotansimha authored and DAB0mB committed Jan 24, 2017
1 parent 5f75ed9 commit 4a7dc24123bd8c4694c4d7d2905e56288f5ad659
Showing with 29 additions and 3 deletions.
  1. +29 −3 webpack.config.js
View
@@ -13,9 +13,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: [
{
@@ -31,14 +38,33 @@ module.exports = {
},
plugins: [
ionicWebpackFactory.getIonicEnvironmentPlugin()
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 4a7dc24

Please sign in to comment.