chore: webpack upgrade (#98)

* upgraded to webpack 4.x

* updated webpack
This commit is contained in:
Jamie Peabody
2018-11-17 09:12:45 +00:00
committed by GitHub
parent 3d44470103
commit d9f2edc1ad
12 changed files with 254 additions and 91 deletions

38
webpack.prod.js Normal file
View File

@@ -0,0 +1,38 @@
const webpack = require('webpack');
const path = require('path');
const CopyWebpackPlugin = require('copy-webpack-plugin');
module.exports = {
mode: 'production',
entry: {
mergely: './src/mergely.js',
},
output: {
path: path.join(__dirname, 'lib'),
filename: './[name].js',
library: 'mergely',
libraryTarget: 'umd',
umdNamedDefine: true
},
module: {
rules: [{
test: /\.(js)$/,
exclude: /node_modules/,
use: ['babel-loader']
}]
},
resolve: {
extensions: ['.js']
},
externals: {
jquery: 'jQuery',
CodeMirror: 'CodeMirror'
},
plugins: [
new CopyWebpackPlugin([{
from: 'src/mergely.css',
to: 'mergely.css',
toType: 'file'
}])
]
};