2019-01-15 18:36:09 +00:00
|
|
|
const path = require("path");
|
|
|
|
const webpack = require("webpack");
|
|
|
|
const merge = require("webpack-merge");
|
|
|
|
|
2019-02-26 17:07:00 +00: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
|
|
|
|
},
|
|
|
|
externals: ["tslib", "trash"],
|
|
|
|
entry: "./packages/server/src/cli.ts",
|
|
|
|
plugins: [
|
|
|
|
new webpack.DefinePlugin({
|
|
|
|
"process.env.BUILD_DIR": `"${__dirname}"`,
|
|
|
|
"process.env.CLI": `"${process.env.CLI ? "true" : "false"}"`,
|
|
|
|
}),
|
|
|
|
],
|
2019-01-15 18:36:09 +00:00
|
|
|
},
|
2019-02-26 17:07:00 +00:00
|
|
|
);
|