-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
55 lines (54 loc) · 1.37 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
var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var CopyWebpackPlugin = require('copy-webpack-plugin');
var ProvidePlugin = require('webpack/lib/ProvidePlugin');
module.exports = {
devtool: 'source-map',
debug: true,
entry: ['./src/config/polyfills.ts', './src/config/main.ts'],
output: {
path: './dist',
filename: 'app.bundle.js',
sourceMapFilename: 'app.bundle.map'
},
module: {
loaders: [
{ test: /\.ts$/, loader: 'ts', exclude: 'node_modules' },
{ test: /\.html$/, loader: 'raw' },
{ test: /\.css$/, loader: 'raw' },
{ test: /\.scss$/, loaders: ['raw', 'sass'] },
{ test: /\.json$/, loader: 'json-loader' }
]
},
resolve: {
extensions: ['', '.js', '.ts', '.html', '.css', '.scss', '.json']
},
plugins: [
new HtmlWebpackPlugin({
template: './src/index.html'
}),
new CopyWebpackPlugin([
{ from: 'src/assets', to: 'assets' }
]),
new webpack.DefinePlugin({
app: {
environment: JSON.stringify(process.env.APP_ENVIRONMENT || 'development')
}
}),
new ProvidePlugin({
jQuery: 'jquery',
'window.jQuery': 'jquery',
$: 'jquery',
'window.$': 'jquery'
})
],
tslint: {
emitErrors: true,
failOnHint: true,
resourcePath: 'src'
},
devServer: {
port: 7000,
host: 'localhost'
}
}