-
Notifications
You must be signed in to change notification settings - Fork 35
/
webpack.config.js
44 lines (42 loc) · 1.19 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
var webpack = require('webpack');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var packageJson = require('./package.json');
var version = packageJson.version;
module.exports = {
entry: {
'angular-popups': './src/popups.js',
'angular-popups-nocss': './src/popups-nocss.js'
},
output: {
path: 'dist',
filename: '[name].js'
},
devtool: 'source-map',
plugins: [
new ExtractTextPlugin('[name].css'),
new webpack.BannerPlugin(packageJson.name + '@' + packageJson.version + ' | ' + packageJson.homepage)
],
externals: {
angular: 'angular'
},
module: {
preLoaders: [{
test: /\.js$/,
exclude: /node_modules/,
loader: 'jshint-loader'
}],
loaders: [
//{test: /\.css$/, loader: ExtractTextPlugin.extract('style-loader', 'css-loader')}, // 把 CSS 抽离成独立的文件
{
test: /\.css$/,
loader: 'style!css?sourceMap&minimize'
}
]
},
jshint: {
camelcase: true,
emitErrors: false,
failOnHint: false,
reporter: function(errors) {}
}
};