-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
36 lines (34 loc) · 990 Bytes
/
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
const path = require('path')
const pkg = JSON.parse(require('fs').readFileSync('package.json'))
const webpack = require('webpack')
const HtmlWebpackPlugin = require('html-webpack-plugin')
let moduleName = pkg.name
if (process.argv.indexOf('-p') >= 0 || process.argv.indexOf('--optimize-minimize') >= 0)
moduleName +='.min'
module.exports = {
entry: {
[ moduleName ]: './src/module.js'
},
output: {
path: path.resolve(__dirname, './dist'),
filename: '[name].js'
},
module: {
loaders: [
{ test: /\.css$/, loader: 'style-loader!css-loader' },
]
},
plugins: [
new webpack.BannerPlugin({
banner: `Helptip v${ pkg.version } - © Upplication ${ (new Date()).getFullYear() }`,
entryOnly: true,
}),
new HtmlWebpackPlugin({
inject: 'head',
template: './src/index.html',
}),
],
externals: {
'angular': 'angular',
}
}