2019-01-15 21:36:09 +03:00
|
|
|
const path = require("path");
|
|
|
|
const webpack = require("webpack");
|
|
|
|
const merge = require("webpack-merge");
|
|
|
|
const StringReplacePlugin = require("string-replace-webpack-plugin");
|
2019-01-19 00:46:40 +03:00
|
|
|
const HappyPack = require("happypack");
|
2019-01-15 21:36:09 +03:00
|
|
|
|
|
|
|
module.exports = merge({
|
2019-01-19 00:46:40 +03:00
|
|
|
devtool: "none",
|
2019-01-15 21:36:09 +03:00
|
|
|
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: () => / /,
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}),
|
|
|
|
},
|
2019-02-05 20:15:20 +03:00
|
|
|
{
|
|
|
|
test: /node\-pty\/lib\/index\.js/,
|
|
|
|
loader: StringReplacePlugin.replace({
|
|
|
|
replacements: [
|
|
|
|
{
|
|
|
|
pattern: /exports\.native.*;/,
|
|
|
|
replacement: () => "exports.native = null;",
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}),
|
|
|
|
},
|
2019-01-15 21:36:09 +03:00
|
|
|
],
|
|
|
|
},
|
|
|
|
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-05 20:15:20 +03:00
|
|
|
externals: ["spdlog", "tslib"],
|
2019-01-15 21:36:09 +03:00
|
|
|
entry: "./packages/server/src/cli.ts",
|
|
|
|
target: "node",
|
|
|
|
plugins: [
|
|
|
|
new webpack.DefinePlugin({
|
|
|
|
"process.env.BUILD_DIR": `"${__dirname}"`,
|
2019-01-19 00:46:40 +03:00
|
|
|
"process.env.CLI": `"${process.env.CLI ? "true" : "false"}"`,
|
2019-01-15 21:36:09 +03:00
|
|
|
}),
|
|
|
|
],
|
2019-01-19 00:46:40 +03:00
|
|
|
}, require("../../scripts/webpack.general.config")(), {
|
2019-01-15 21:36:09 +03:00
|
|
|
mode: "development",
|
|
|
|
});
|