1 | var pkg = require('./package.json');
|
2 | var webpack = require('webpack');
|
3 | var ExtractTextPlugin = require('extract-text-webpack-plugin');
|
4 |
|
5 | module.exports = {
|
6 | devtool: false,
|
7 | entry: {
|
8 | vconsole : './src/vconsole.js'
|
9 | },
|
10 | output: {
|
11 | path: './dist',
|
12 | filename: '[name].min.js',
|
13 | library: 'vConsole',
|
14 | libraryTarget: 'umd',
|
15 | umdNameDefine: true
|
16 | },
|
17 | module: {
|
18 | loaders: [
|
19 | {
|
20 | test: /\.html$/, loader: 'html'
|
21 | },
|
22 | {
|
23 | test: /\.js$/, loader: 'babel'
|
24 | },
|
25 | {
|
26 | test: /\.less$/,
|
27 | loader: 'style!css!less'
|
28 |
|
29 | },
|
30 | {
|
31 | test: /\.json$/, loader: 'json'
|
32 | }
|
33 | ]
|
34 | },
|
35 | plugins: [
|
36 | new webpack.BannerPlugin([
|
37 | pkg.name + ' v' + pkg.version + ' (' + pkg.homepage + ')',
|
38 | 'Copyright ' + new Date().getFullYear() + ', ' + pkg.author,
|
39 | pkg.license +' license'
|
40 | ].join('\n'))
|
41 | ,new webpack.optimize.UglifyJsPlugin({
|
42 | compress: {
|
43 | warnings: false
|
44 | }
|
45 | })
|
46 |
|
47 | ]
|
48 |
|
49 | }; |
\ | No newline at end of file |