2019-01-16 01:36:09 +07:00
|
|
|
const path = require("path");
|
|
|
|
const webpack = require("webpack");
|
|
|
|
const merge = require("webpack-merge");
|
|
|
|
|
2019-02-27 00:07:00 +07:00
|
|
|
const root = path.resolve(__dirname, "../..");
|
|
|
|
|
|
|
|
module.exports = merge(
|
|
|
|
require(path.join(root, "scripts/webpack.node.config.js"))({
|
2019-04-18 05:18:20 +07:00
|
|
|
dirname: __dirname,
|
2019-02-27 00:07:00 +07:00
|
|
|
}), {
|
|
|
|
output: {
|
|
|
|
filename: "cli.js",
|
|
|
|
libraryTarget: "commonjs",
|
|
|
|
},
|
|
|
|
node: {
|
|
|
|
console: false,
|
|
|
|
global: false,
|
|
|
|
process: false,
|
|
|
|
Buffer: false,
|
|
|
|
__filename: false,
|
|
|
|
__dirname: false,
|
|
|
|
setImmediate: false
|
|
|
|
},
|
2019-03-27 01:01:25 +07:00
|
|
|
externals: {
|
|
|
|
"nbin": "commonjs nbin",
|
|
|
|
},
|
2019-02-27 00:07:00 +07:00
|
|
|
entry: "./packages/server/src/cli.ts",
|
|
|
|
plugins: [
|
|
|
|
new webpack.DefinePlugin({
|
2019-03-01 03:04:19 +07:00
|
|
|
"process.env.BUILD_DIR": `"${__dirname.replace(/\\/g, "\\\\")}"`,
|
2019-02-27 00:07:00 +07:00
|
|
|
"process.env.CLI": `"${process.env.CLI ? "true" : "false"}"`,
|
|
|
|
}),
|
|
|
|
],
|
2019-01-16 01:36:09 +07:00
|
|
|
},
|
2019-02-27 00:07:00 +07:00
|
|
|
);
|