-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.config.js
72 lines (68 loc) · 1.92 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
var webpack = require('webpack');
var CommonsChunkPlugin = webpack.optimize.CommonsChunkPlugin;
module.exports = {
debug: true,
devtool: 'source-map',
entry: {
'vendor': ['./app/polyfills', './app/vendor'],
'app': './app/main'
},
output: {
path: __dirname + "/dist",
filename: "[name].js",
publicPath: "dist/"
},
resolve: {
extensions: ['', '.ts', '.js', '.jpg', '.jpeg', '.gif', '.png', '.css'],
alias: {
materializecss: 'materialize-css/dist/css/materialize.css',
materialize: 'materialize-css/dist/js/materialize.js',
}
},
module: {
loaders: [
/* Note on angular2-materialize.
* Added the next following 4 objects in order to follow angular2-materialize recomendations
*/
{ test: /materialize\.css$/, loader: 'style-loader!css-loader' },
{
test: /materialize-css\/dist\/js\/materialize\.js/,
loader: 'imports?materializecss'
},
{
test: /^((?!materialize).)*\.css$/,
loader: 'raw-loader'
},
{ test: /.(png|woff(2)?|eot|ttf|svg)(\?[a-z0-9=\.]+)?$/, loader: 'url-loader?limit=100000' },
/*
* End note on angular2-materialize.
*/
{ test: /\.(jpg|jpeg|gif|png)$/, loader: 'file-loader?name=img/[path][name].[ext]' },
//{ test: /\.css$/, loader: 'raw-loader' },
{ test: /\.html$/, loaders: ['html-loader'] },
{ test: /\.ts$/, loaders: ['awesome-typescript-loader'], exclude: /node_modules/ },
]
},
modulesDirectories: ['node_modules'],
plugins: [
new CommonsChunkPlugin({ name: 'vendor' }),
new webpack.ProvidePlugin({
$: "jquery",
jQuery: "jquery",
"window.jQuery": "jquery",
Hammer: "hammerjs/hammer"
})
],
node: {
__filename: true
},
devServer: {
inline: true,
port: 8080,
historyApiFallback: true,
watchOptions: {
aggregateTimeout: 300,
poll: 1000
}
}
};