-
Notifications
You must be signed in to change notification settings - Fork 3
/
webpack.prod.js
65 lines (64 loc) · 1.41 KB
/
webpack.prod.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
const path = require('path')
const merge = require('webpack-merge')
const UglifyJSPlugin = require('uglifyjs-webpack-plugin')
const common = require('./webpack.common.js')
const CleanWebpackPlugin = require('clean-webpack-plugin')
module.exports = [
// Client side package
merge(common, {
devtool: 'source-map',
plugins: [
new CleanWebpackPlugin(['dist']),
new UglifyJSPlugin({
sourceMap: true
})
],
entry: {
index: './src/index.js'
},
output: {
path: path.join(__dirname, 'dist'),
filename: '[name].js',
library: 'quillUrlEmbeds',
libraryTarget: 'umd'
},
externals: {
lodash: {
commonjs: 'lodash',
commonjs2: 'lodash',
amd: 'lodash',
root: '_'
},
quill: {
commonjs: 'quill',
commonjs2: 'quill',
amd: 'quill',
root: 'Quill'
},
'quill-delta': {
commonjs: 'quill-delta',
commonjs2: 'quill-delta',
amd: 'quill-delta',
root: 'Delta'
}
}
}),
// Server side package
merge(common, {
devtool: 'source-map',
target: 'node',
plugins: [
new UglifyJSPlugin({
sourceMap: true
})
],
entry: {
'embed-to-anchor': './src/utils/embed-to-anchor.js'
},
output: {
path: path.join(__dirname, 'dist'),
filename: '[name].js',
libraryTarget: 'umd'
}
})
]