UNPKG

691 BJavaScriptView Raw
1const webpack = require('webpack')
2const CleanPlugin = require('clean-webpack-plugin')
3const path = require('path')
4
5module.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}