This repository has been archived by the owner on Feb 17, 2024. It is now read-only.
forked from tjoskar/ng-lazyload-image
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathwebpack.config.js
76 lines (65 loc) · 1.98 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
69
70
71
72
73
74
75
76
const path = require('path');
const webpack = require('webpack');
const ForkCheckerPlugin = require('awesome-typescript-loader').ForkCheckerPlugin;
const ENV = process.env.ENV = process.env.NODE_ENV = 'development';
const HMR = true;
module.exports = {
devtool: 'inline-source-map',
cache: true,
debug: false,
entry: {
'polyfills': './example/polyfills.ts',
'vendor': './example/vendor.ts',
'main': './example/boot.ts'
},
resolve: {
extensions: ['', '.ts', '.js']
},
output: {
path: './example',
filename: '[name].bundle.js',
sourceMapFilename: '[name].js.map',
chunkFilename: '[id].chunk.js'
},
module: {
preLoaders: [
{
test: /\.js$/,
loader: 'source-map-loader',
exclude: [
// these packages have problems with their sourcemaps
path.resolve(__dirname, 'node_modules/rxjs'),
path.resolve(__dirname, 'node_modules/@angular')
]
}
],
loaders: [
{ test: /\.ts$/, loader: 'awesome-typescript-loader' },
// Support for CSS as raw text
{ test: /\.css$/, loader: 'raw-loader' },
{ test: /\.scss$/, loaders: ["style", "css", "sass"] },
// support for .html as raw text
{ test: /\.html$/, loader: 'raw-loader', exclude: [ './src/index.html' ] }
]
},
devServer: {
port: 9000,
host: 'localhost',
historyApiFallback: true,
contentBase: path.resolve(__dirname, 'example'),
watchOptions: {
aggregateTimeout: 300,
poll: 1000
}
},
plugins: [
new ForkCheckerPlugin(),
new webpack.DefinePlugin({
HMR,
ENV: JSON.stringify(ENV)
}),
new webpack.optimize.CommonsChunkPlugin({
name: ['vendor', 'polyfills']
})
]
};