Skip to content

Commit

Permalink
Step 1.2: Add Ionic's base webpack file to the project
Browse files Browse the repository at this point in the history
  • Loading branch information
dotansimha authored and DAB0mB committed Mar 23, 2017
1 parent 0e579fd commit 5f75ed9
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions webpack.config.js
@@ -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.