-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.lib.js
35 lines (33 loc) · 1 KB
/
webpack.lib.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
const path = require('path');
const webpack = require('webpack');
const merge = require('webpack-merge');
const CleanWebpackPlugin = require('clean-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
const common = require('./webpack.common.js');
module.exports = merge(common, {
entry: './src/lib/index.ts',
devtool: 'source-map',
plugins: [
new CleanWebpackPlugin(['dist']),
new UglifyJSPlugin({
sourceMap: true
}),
new webpack.DefinePlugin({
'process.env': {
'NODE_ENV': JSON.stringify('production')
}
}),
new CopyWebpackPlugin([
{from: 'src/lib/index.d.ts'},
{from: 'src/lib/index.css'}
])
],
output: {
path: path.resolve(__dirname, './dist'),
filename: 'slider.js',
libraryTarget: 'umd',
libraryExport: 'default',
library: 'slider'
}
});