-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
63 lines (61 loc) · 1.52 KB
/
webpack.config.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
const path = require('path')
const webpack = require('webpack')
const TerserPlugin = require('terser-webpack-plugin')
const ASSET_PATH = process.env.ASSET_PATH || './'
module.exports = {
mode: 'production',
devtool: 'source-map',
entry: {
"src/loader": { import: path.join(__dirname, 'src', 'index.js') },
"build/loader.min": { import: path.join(__dirname, 'src', 'index.js') },
},
output: {
path: path.resolve(__dirname, 'amd'),
publicPath: ASSET_PATH,
filename: '[name].js',
chunkFilename: '[name].js?v=[contenthash]',
libraryTarget: 'amd',
},
externals: {
'core/ajax': {
amd: 'core/ajax'
},
'core/str': {
amd: 'core/str'
},
'core/modal_factory': {
amd: 'core/modal_factory'
},
'core/modal_events': {
amd: 'core/modal_events'
},
'core/fragment': {
amd: 'core/fragment'
},
'core/yui': {
amd: 'core/yui'
},
'core/localstorage': {
amd: 'core/localstorage'
},
'core/notification': {
amd: 'core/notification'
},
'jquery': {
amd: 'jquery'
},
},
plugins: [
new webpack.ProvidePlugin({
$: "jquery",
jQuery: "jquery"
}),
],
optimization: {
minimize: true,
minimizer: [new TerserPlugin()],
},
resolve: {
extensions: ['.js', '.json'],
}
}