-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.demos.config.js
58 lines (50 loc) · 1.41 KB
/
webpack.demos.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
var path = require('path');
var ExtractTextPlugin = require("extract-text-webpack-plugin");
var destFolder = '/build';
var config = {
context: __dirname,
debug: true,
cache: true,
verbose: true,
displayErrorDetails: true,
stats: {
colors: true,
reasons: true
},
entry: {
'demo_vendor_libs': [
'angular',
'angular-animate',
'angular-aria',
'angular-messages',
'angular-material',
'angular-sanitize',
'rx',
'rx-angular',
'./node_modules/angular-material/angular-material.css'
]
},
output: {
path: path.join(__dirname, destFolder),
filename: '[name].js',
sourceMapFilename: '[name].js.map',
chunkFilename: '[id].chunk.js',
libraryTarget: 'umd'
},
// modles to compile .less and include .css
// in the .ts use code like: require('./button.less');
module: {
loaders: [{
test: /\.css$/,
loader: ExtractTextPlugin.extract("style-loader", "css-loader")
}, {
test: /\.less$/,
loader: ExtractTextPlugin.extract('style', 'css!less')
}]
},
// Use the plugin to specify the resulting filename (and add needed behavior to the compiler)
plugins: [
new ExtractTextPlugin("[name].css")
]
};
module.exports = config;