1 | const webpack = require('webpack')
|
2 | const CleanPlugin = require('clean-webpack-plugin')
|
3 | const path = require('path')
|
4 |
|
5 | module.exports = {
|
6 | entry: path.resolve(__dirname, '../src/index.js'),
|
7 | output: {
|
8 | path: path.resolve(__dirname, '../dist'),
|
9 | filename: 'index.js',
|
10 | libraryTarget: 'umd'
|
11 | },
|
12 | module: {
|
13 | loaders: [
|
14 | {
|
15 | test: /\.js$/,
|
16 | loader: 'babel-loader',
|
17 | exclude: /node_modules/
|
18 | }
|
19 | ]
|
20 | },
|
21 | plugins: [
|
22 | new CleanPlugin(['dist']),
|
23 | new webpack.optimize.UglifyJsPlugin({
|
24 | output: {
|
25 | comments: false,
|
26 | },
|
27 | compress: {
|
28 | warnings: false
|
29 | }
|
30 | })
|
31 | ],
|
32 | resolve: {
|
33 | modules: ['node_modules']
|
34 | }
|
35 | }
|