-
Notifications
You must be signed in to change notification settings - Fork 6
/
webpack.config.js
68 lines (59 loc) · 1.8 KB
/
webpack.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
const path = require('path');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const AureliaWebpackPlugin = require('aurelia-webpack-plugin');
//const BabiliPlugin = require('babili-webpack-plugin'); // ES6 compatible minfication/compresion
module.exports = {
entry: {
main: [
'./ie-polyfill',
'aurelia-bootstrapper'
]
},
output: {
path: path.resolve(__dirname, 'dist'),
publicPath: '/',
filename: '[name].js',
chunkFilename: '[name].js'
},
resolve: {
extensions: ['.js'],
modules: ['src', 'node_modules'],
},
module: {
rules: [
{ test: /\.(js)$/,
loaders: 'babel-loader',
exclude: /node_modules/,
query: { // use 'babel-preset-env' without transforming ES6 modules, and with added support for decorators
presets: [['env', { modules: false }]],
plugins: [ 'transform-decorators-legacy', 'transform-class-properties']
}
},
{ test: /\.css$/i,
use: [
'style-loader',
'css-loader'
]
},
{ test: /\.html$/i,
use: 'html-loader' }
]
},
plugins: [
// required polyfills for non-evergreen browsers
new webpack.ProvidePlugin({
Map: 'core-js/es6/map',
WeakMap: 'core-js/es6/weak-map',
Promise: 'core-js/es6/promise',
regeneratorRuntime: 'regenerator-runtime' // to support await/async syntax
}),
// init aurelia-webpack-plugin
new AureliaWebpackPlugin.AureliaPlugin(),
// have Webpack copy over the index.html and inject appropriate script tag for Webpack-bundled entry point 'main.js'
new HtmlWebpackPlugin({
template: '!html-webpack-plugin/lib/loader!index.html',
filename: 'index.html'
})
]
};