-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwebpack.prod.js
55 lines (46 loc) · 1.37 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
/* eslint-disable @typescript-eslint/naming-convention */
//@ts-check
"use strict";
//@ts-check
/** @typedef {import('webpack').Configuration} WebpackConfig **/
const { merge } = require("webpack-merge");
const CopyPlugin = require("copy-webpack-plugin");
const common = require("./webpack.common.js");
/** @type WebpackConfig */
const extensionConfig = merge(common[0], {
mode: "production",
devtool: 'hidden-source-map',
});
/** @type WebpackConfig */
const webExtensionConfig = merge(common[1], {
mode: "production",
devtool: 'hidden-source-map',
});
/** @type WebpackConfig */
const webviewConfig = merge(common[2], {
mode: "production",
devtool: 'hidden-source-map',
optimization: {
usedExports: true,
minimize: true,
},
plugins: [
new CopyPlugin({
patterns: [
{ from: "./node_modules/react/umd/react.production.min.js", to: "lib/react.js" },
{ from: "./node_modules/react-dom/umd/react-dom.production.min.js", to: "lib/react-dom.js" },
],
}),
],
});
/** @type WebpackConfig */
const lspServerNodeConfig = merge(common[3], {
mode: "production",
devtool: 'hidden-source-map',
});
/** @type WebpackConfig */
const lspServerWebConfig = merge(common[4], {
mode: "production",
devtool: 'hidden-source-map',
});
module.exports = [extensionConfig, webExtensionConfig, webviewConfig, lspServerNodeConfig, lspServerWebConfig];