-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathwebpack.config.js
More file actions
66 lines (61 loc) · 1.42 KB
/
webpack.config.js
File metadata and controls
66 lines (61 loc) · 1.42 KB
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
"use strict";
const webpack = require("webpack");
const path = require("path");
const extensionPackage = require("./packages/textlint/package.json");
const merge = require("merge-options");
/**@type {import('webpack').Configuration}*/
const config = {
target: "node",
output: {
path: path.resolve(__dirname, "packages/textlint/dist"),
libraryTarget: "commonjs",
},
stats: {
errorDetails: true,
},
devtool: "source-map",
externals: [
{
vscode: "commonjs vscode",
textlint: "commonjs textlint",
},
],
resolve: {
extensions: [".ts", ".js"],
modules: [path.resolve(__dirname, "node_modules"), "node_modules"],
},
module: {
rules: [
{
test: /\.ts$/,
exclude: /node_modules/,
use: [
{
loader: "ts-loader",
},
],
},
],
},
};
/**@type {import('webpack').Configuration}*/
const client = merge(config, {
entry: "./packages/textlint/src/extension.ts",
output: {
filename: "extension.js",
},
plugins: [
new webpack.EnvironmentPlugin({
EXTENSION_NAME: `${extensionPackage.publisher}.${extensionPackage.name}`,
EXTENSION_VERSION: extensionPackage.version,
}),
],
});
/**@type {import('webpack').Configuration}*/
const server = merge(config, {
entry: "./packages/textlint-server/src/server.ts",
output: {
filename: "server.js",
},
});
module.exports = [client, server];