Skip to content

Commit 7da2871

Browse files
committed
add webpack config
1 parent 79c8ce6 commit 7da2871

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

webpack.config.js

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
'use strict';
2+
3+
const webpack = require('webpack');
4+
const path = require('path');
5+
6+
module.exports = {
7+
entry: './src/react-aplayer.js',
8+
output: {
9+
path: path.resolve(__dirname, './dist'),
10+
filename: 'react-aplayer.min.js',
11+
libraryTarget: 'umd'
12+
},
13+
externals: ['react'],
14+
module: {
15+
rules: [
16+
{
17+
test: /(\.js)|(\.jsx)$/,
18+
exclude: /(node_modules|bower_components)/,
19+
use: {
20+
loader: 'babel-loader',
21+
options: {
22+
presets: ['es2015', 'react']
23+
}
24+
}
25+
}
26+
]
27+
},
28+
plugins: [
29+
new webpack.LoaderOptionsPlugin({
30+
debug: false
31+
}),
32+
new webpack.optimize.UglifyJsPlugin({
33+
compress: {
34+
warnings: false,
35+
comparisons: false,
36+
},
37+
output: {
38+
comments: false,
39+
},
40+
sourceMap: true,
41+
})]
42+
};

0 commit comments

Comments
 (0)