Improve webpack configuration.

This commit is contained in:
Alexis Lahouze 2017-10-09 08:21:48 +02:00
parent 1a5f886810
commit c53f917374

View File

@ -5,7 +5,14 @@ const webpack = require('webpack');
module.exports = {
context: path.resolve(__dirname, 'src'),
entry: './main.ts',
entry: {
"main": [
'./main.ts'
],
"styles": [
'./main.scss'
]
},
devtool: 'source-map',
resolve: {
extensions: ['.js', '.jsx', '.ts', '.tsx', '.html'],
@ -92,9 +99,6 @@ module.exports = {
}]
},
plugins: [
new HtmlWebpackPlugin({
title: 'Accountant',
template: 'index.ejs'
}),
new webpack.ProvidePlugin({
"window.jQuery": "jquery"
@ -102,11 +106,21 @@ module.exports = {
new webpack.ContextReplacementPlugin(
/angular(\\|\/)core(\\|\/)@angular/,
path.resolve(__dirname, './')
)
),
new HtmlWebpackPlugin({
title: 'Accountant',
template: 'index.ejs',
hash: false,
inject: true,
compile: true,
minify: false,
chunks: 'all'
})
],
output: {
path: path.resolve(__dirname, 'build'),
filename: 'js/bundle.js',
filename: '[name].bundle.js',
chunkFilename: '[name].chunk.js'
//publicPath: 'js'
},
devServer: {