Permalink
Browse files

Step 1.2: Add Ionic's base webpack file to the project

  • Loading branch information...
dotansimha authored and DAB0mB committed Jan 24, 2017
1 parent 0e579fd commit 5f75ed9bc4dc1018cad51b5188005cf2949a6d3e
Showing with 44 additions and 0 deletions.
  1. +44 −0 webpack.config.js
View
@@ -0,0 +1,44 @@
var path = require('path');
var webpack = require('webpack');
var ionicWebpackFactory = require(process.env.IONIC_WEBPACK_FACTORY);
module.exports = {
entry: process.env.IONIC_APP_ENTRY_POINT,
output: {
path: '{{BUILD}}',
filename: process.env.IONIC_OUTPUT_JS_FILE_NAME,
devtoolModuleFilenameTemplate: ionicWebpackFactory.getSourceMapperFunction(),
},
devtool: process.env.IONIC_GENERATE_SOURCE_MAP ? process.env.IONIC_SOURCE_MAP_TYPE : '',
resolve: {
extensions: ['.ts', '.js', '.json'],
modules: [path.resolve('node_modules')]
},
module: {
loaders: [
{
test: /\.json$/,
loader: 'json-loader'
},
{
//test: /\.(ts|ngfactory.js)$/,
test: /\.ts$/,
loader: process.env.IONIC_WEBPACK_LOADER
}
]
},
plugins: [
ionicWebpackFactory.getIonicEnvironmentPlugin()
],
// 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'
}
};

0 comments on commit 5f75ed9

Please sign in to comment.