forked from softwareCobbler/cfc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
96 lines (94 loc) · 3.2 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
const path = require('path');
const CopyPlugin = require("copy-webpack-plugin");
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
module.exports = [{
mode: "development", // "production" | "development" | "none"
target: "node",
entry: "./src/lang-server/client/src/extension.ts",
output: {
path: path.resolve("./cflsp-vscode/out/"), // string (default)
filename: "cflsp.js", // string (default)
library: {
type: "commonjs2",
},
uniqueName: "cflsp", // (defaults to package.json "name")
},
resolve: {
extensions: [".ts", ".tsx", ".js"],
plugins: [new TsconfigPathsPlugin({ configFile: "./src/lang-server/client/tsconfig.json" })]
},
externals: {
// https://github.com/microsoft/vscode/issues/102314
// the vscode-module is created on-the-fly and must be excluded.
// Add other modules that cannot be webpack'ed, 📖 -> https://webpack.js.org/configuration/externals/
vscode: 'commonjs vscode',
},
module: {
rules: [
// all files with a `.ts` or `.tsx` extension will be handled by `ts-loader`
{
test: /\.tsx?$/,
use: {
loader: "ts-loader",
options: {
projectReferences: true,
configFile: "tsconfig.json"
}
}
}
]
},
devtool: "source-map",
},
{
//watch: true,
//watchOptions: {
// aggregateTimeout: 2500
//},
mode: "development", // "production" | "development" | "none"
target: "node",
entry: "./src/lang-server/server/src/server.ts",
output: {
path: path.resolve("./cflsp-vscode/out/"), // string (default)
filename: "server.js", // string (default)
//library: {
// type: "commonjs2",
//},
uniqueName: "cfls", // (defaults to package.json "name")
},
resolve: {
extensions: [".ts", ".tsx", ".js"],
plugins: [new TsconfigPathsPlugin({ configFile: "./src/lang-server/server/tsconfig.json" })]
},
externals: {
// https://github.com/microsoft/vscode/issues/102314
// the vscode-module is created on-the-fly and must be excluded.
// Add other modules that cannot be webpack'ed, 📖 -> https://webpack.js.org/configuration/externals/
vscode: 'commonjs vscode',
},
module: {
rules: [
// all files with a `.ts` or `.tsx` extension will be handled by `ts-loader`
{
test: /\.tsx?$/,
use: {
loader: "ts-loader",
options: {
projectReferences: true,
configFile: "tsconfig.json"
}
}
}
]
},
devtool: "source-map",
plugins: [
new CopyPlugin({
patterns: [{
from: "./src/lang-server/server/src/runtimelib/lib.cf2018.d.cfm",
to: "lib.cf2018.d.cfm",
}],
}),
],
},
]