Archived
1
0
This repository has been archived on 2024-09-09. You can view files and clone it, but cannot push or open issues or pull requests.
code-server/packages/server/webpack.config.js

61 lines
1.4 KiB
JavaScript
Raw Normal View History

const path = require("path");
const webpack = require("webpack");
const merge = require("webpack-merge");
const StringReplacePlugin = require("string-replace-webpack-plugin");
const HappyPack = require("happypack");
module.exports = merge({
devtool: "none",
2019-02-06 19:05:48 +01:00
mode: "development",
module: {
rules: [
{
test: /@oclif\/command\/lib\/index\.js/,
loader: StringReplacePlugin.replace({
replacements: [
{
// This is required otherwise it attempts to require("package.json")
pattern: /checkNodeVersion\(\)\;/,
replacement: () => / /,
}
]
}),
},
{
test: /node\-pty\/lib\/index\.js/,
loader: StringReplacePlugin.replace({
replacements: [
{
pattern: /exports\.native.*;/,
replacement: () => "exports.native = null;",
}
]
}),
},
],
},
output: {
filename: "cli.js",
path: path.join(__dirname, "./out"),
libraryTarget: "commonjs",
},
node: {
console: false,
global: false,
process: false,
Buffer: false,
__filename: false,
__dirname: false,
setImmediate: false
},
2019-02-07 18:05:17 +01:00
externals: ["spdlog", "tslib", "trash"],
entry: "./packages/server/src/cli.ts",
target: "node",
plugins: [
new webpack.DefinePlugin({
"process.env.BUILD_DIR": `"${__dirname}"`,
"process.env.CLI": `"${process.env.CLI ? "true" : "false"}"`,
}),
],
2019-02-06 19:05:48 +01:00
}, require("../../scripts/webpack.general.config")());