2019-01-16 02:36:09 +08:00
|
|
|
const path = require("path");
|
|
|
|
const webpack = require("webpack");
|
|
|
|
const merge = require("webpack-merge");
|
|
|
|
|
2019-02-27 01:07:00 +08:00
|
|
|
const root = path.resolve(__dirname, "../..");
|
|
|
|
|
|
|
|
module.exports = merge(
|
|
|
|
require(path.join(root, "scripts/webpack.node.config.js"))({
|
|
|
|
// Config options.
|
|
|
|
}), {
|
|
|
|
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-28 12:16:31 +08:00
|
|
|
resolve: {
|
|
|
|
alias: {
|
2019-03-07 08:15:52 +08:00
|
|
|
"node-pty": "node-pty-prebuilt",
|
2019-02-28 12:16:31 +08:00
|
|
|
},
|
|
|
|
},
|
2019-03-13 02:09:20 +08:00
|
|
|
externals: ["tslib"],
|
2019-02-27 01:07:00 +08:00
|
|
|
entry: "./packages/server/src/cli.ts",
|
|
|
|
plugins: [
|
|
|
|
new webpack.DefinePlugin({
|
2019-03-01 04:04:19 +08:00
|
|
|
"process.env.BUILD_DIR": `"${__dirname.replace(/\\/g, "\\\\")}"`,
|
2019-02-27 01:07:00 +08:00
|
|
|
"process.env.CLI": `"${process.env.CLI ? "true" : "false"}"`,
|
|
|
|
}),
|
|
|
|
],
|
2019-01-16 02:36:09 +08:00
|
|
|
},
|
2019-02-27 01:07:00 +08:00
|
|
|
);
|