Skip to content

Commit

Permalink
add webpack config
Browse files Browse the repository at this point in the history
  • Loading branch information
sabrinaluo committed Aug 13, 2017
1 parent 79c8ce6 commit 7da2871
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
'use strict';

const webpack = require('webpack');
const path = require('path');

module.exports = {
entry: './src/react-aplayer.js',
output: {
path: path.resolve(__dirname, './dist'),
filename: 'react-aplayer.min.js',
libraryTarget: 'umd'
},
externals: ['react'],
module: {
rules: [
{
test: /(\.js)|(\.jsx)$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: 'babel-loader',
options: {
presets: ['es2015', 'react']
}
}
}
]
},
plugins: [
new webpack.LoaderOptionsPlugin({
debug: false
}),
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false,
comparisons: false,
},
output: {
comments: false,
},
sourceMap: true,
})]
};

0 comments on commit 7da2871

Please sign in to comment.