-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwebpack.dev.js
78 lines (69 loc) · 2.72 KB
/
webpack.dev.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
66
67
68
69
70
71
72
73
74
75
76
77
78
/* 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: "none", // this leaves the source code as close as possible to the original (when packaging we set this to 'production')
devtool: 'nosources-source-map', // create a source map that points to the original source file
// plugins: [
// new webpack.SourceMapDevToolPlugin({
// filename: '[file].map[query]',
// sourceRoot: 'extension'
// })
// ],
infrastructureLogging: {
level: "log", // enables logging required for problem matchers
},
});
/** @type WebpackConfig */
const webExtensionConfig = merge(common[1], {
mode: "none", // this leaves the source code as close as possible to the original (when packaging we set this to 'production')
devtool: 'inline-source-map', // create a source map that points to the original source file
// plugins: [
// new webpack.SourceMapDevToolPlugin({
// filename: '[file].map[query]',
// sourceRoot: 'extension'
// })
// ],
infrastructureLogging: {
level: "log", // enables logging required for problem matchers
}
});
/** @type WebpackConfig */
const webviewConfig = merge(common[2], {
mode: "none", // this leaves the source code as close as possible to the original (when packaging we set this to 'production')
devtool: "inline-source-map",
infrastructureLogging: {
level: "log", // enables logging required for problem matchers
},
plugins: [
new CopyPlugin({
patterns: [
{ from: "./node_modules/react/umd/react.development.js", to: "lib/react.js" },
{ from: "./node_modules/react-dom/umd/react-dom.development.js", to: "lib/react-dom.js" },
],
}),
],
});
/** @type WebpackConfig */
const lspServerNodeConfig = merge(common[3], {
mode: "none", // this leaves the source code as close as possible to the original (when packaging we set this to 'production')
devtool: "inline-source-map",
infrastructureLogging: {
level: "log", // enables logging required for problem matchers
}
});
/** @type WebpackConfig */
const lspServerWebConfig = merge(common[4], {
mode: "none", // this leaves the source code as close as possible to the original (when packaging we set this to 'production')
devtool: "inline-source-map",
infrastructureLogging: {
level: "log", // enables logging required for problem matchers
}
});
module.exports = [extensionConfig, webExtensionConfig, webviewConfig, lspServerNodeConfig, lspServerWebConfig];