Skip to content

Instantly share code, notes, and snippets.

@ivan-marquez
Created July 19, 2016 01:54
Show Gist options
  • Save ivan-marquez/1b66a12e195e9a7fa5e053892436005c to your computer and use it in GitHub Desktop.
Save ivan-marquez/1b66a12e195e9a7fa5e053892436005c to your computer and use it in GitHub Desktop.
Webpack config file sample
var path = require('path');
var webpack = require('webpack');
var CommonsChunkPlugin = webpack.optimize.CommonsChunkPlugin;
module.exports = {
devtool: 'source-map',
debug: true,
entry: {
'app': './src/app/main'
},
output: {
path: __dirname + '/build/',
publicPath: 'build/',
filename: '[name].js',
sourceMapFilename: '[name].js.map',
chunkFilename: '[id].chunk.js'
},
resolve: {
extensions: ['', '.ts', '.js', '.json', '.css', '.html']
},
module: {
loaders: [
{
test: /\.ts$/,
loader: 'ts',
exclude: [/node_modules/]
}
]
},
plugins: [
new CommonsChunkPlugin({ name: 'common', filename: 'common.js' })
],
target: 'node-webkit'
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment