2019-02-26 17:07:00 +00:00
|
|
|
const path = require("path");
|
|
|
|
const merge = require("webpack-merge");
|
|
|
|
|
|
|
|
const root = path.resolve(__dirname, "../..");
|
|
|
|
const fills = path.join(root, "packages/ide/src/fill");
|
|
|
|
const vsFills = path.join(root, "packages/vscode/src/fill");
|
|
|
|
|
|
|
|
module.exports = merge(
|
|
|
|
require(path.join(root, "scripts/webpack.node.config.js"))({
|
2019-04-17 22:18:20 +00:00
|
|
|
dirname: __dirname,
|
2019-02-26 17:07:00 +00:00
|
|
|
typescriptCompilerOptions: {
|
2019-03-08 16:37:03 +00:00
|
|
|
target: "es6",
|
2019-02-26 17:07:00 +00:00
|
|
|
},
|
|
|
|
}), {
|
|
|
|
entry: path.join(root, "lib/vscode/src/bootstrap-fork.js"),
|
|
|
|
mode: "development",
|
|
|
|
output: {
|
|
|
|
chunkFilename: "[name].bundle.js",
|
|
|
|
publicPath: "/",
|
|
|
|
filename: "bootstrap-fork.js",
|
|
|
|
libraryTarget: "commonjs",
|
|
|
|
globalObject: "this",
|
|
|
|
},
|
|
|
|
// Due to the dynamic `require.context` we add to `loader.js` Webpack tries
|
|
|
|
// to include way too much. We can modify what Webpack imports in this case
|
|
|
|
// (I believe), but for now ignore some things.
|
|
|
|
module: {
|
|
|
|
rules: [{
|
|
|
|
test: /\.(txt|d\.ts|perf\.data\.js|jxs|scpt|exe|sh|less|html|s?css|qwoff|md|svg|png|ttf|woff|eot|woff2)$/,
|
|
|
|
use: [{
|
|
|
|
loader: "ignore-loader",
|
|
|
|
}],
|
|
|
|
}, {
|
|
|
|
test: /test|tsconfig/,
|
|
|
|
use: [{
|
|
|
|
loader: "ignore-loader",
|
|
|
|
}],
|
|
|
|
}, {
|
2019-04-05 23:49:29 +00:00
|
|
|
// The only thing we need in electron-browser is the shared process (including contrib).
|
|
|
|
test: /((\\|\/)vs(\\|\/)code(\\|\/)electron-main(\\|\/))|((\\|\/)test(\\|\/))|(OSSREADME\.json$)|\/browser\/|\/electron-browser\/(?!sharedProcess\/).+\//,
|
2019-02-26 17:07:00 +00:00
|
|
|
use: [{
|
|
|
|
loader: "ignore-loader",
|
|
|
|
}],
|
|
|
|
}],
|
2019-02-28 20:04:19 +00:00
|
|
|
noParse: /(\\|\/)test(\\|\/)|\.test\.jsx?|\.test\.tsx?|tsconfig.+\.json$/,
|
2019-02-26 17:07:00 +00:00
|
|
|
},
|
|
|
|
resolve: {
|
|
|
|
alias: {
|
|
|
|
"gc-signals": path.join(fills, "empty.ts"),
|
|
|
|
"node-pty": path.resolve(fills, "empty.ts"),
|
|
|
|
"windows-mutex": path.resolve(fills, "empty.ts"),
|
|
|
|
"windows-process-tree": path.resolve(fills, "empty.ts"),
|
2019-03-08 16:37:03 +00:00
|
|
|
"vscode-windows-registry": path.resolve(fills, "empty.ts"),
|
2019-04-05 23:49:29 +00:00
|
|
|
"vscode-windows-ca-certs": path.resolve(fills, "empty.ts"),
|
2019-03-08 16:37:03 +00:00
|
|
|
"vscode-sqlite3": path.resolve(fills, "empty.ts"),
|
2019-02-26 20:08:50 +00:00
|
|
|
"vs/base/browser/browser": path.resolve(fills, "empty.ts"),
|
2019-02-26 17:07:00 +00:00
|
|
|
|
|
|
|
"electron": path.join(vsFills, "stdioElectron.ts"),
|
2019-02-27 21:12:26 +00:00
|
|
|
"vscode-ripgrep": path.join(vsFills, "ripgrep.ts"),
|
2019-02-26 17:07:00 +00:00
|
|
|
"native-keymap": path.join(vsFills, "native-keymap.ts"),
|
|
|
|
"native-watchdog": path.join(vsFills, "native-watchdog.ts"),
|
|
|
|
"vs/base/common/amd": path.resolve(vsFills, "amd.ts"),
|
2019-04-17 21:30:50 +00:00
|
|
|
"vs/base/node/paths": path.join(vsFills, "paths.ts"),
|
2019-03-08 16:37:03 +00:00
|
|
|
"vs/platform/product/node/package": path.resolve(vsFills, "package.ts"),
|
|
|
|
"vs/platform/product/node/product": path.resolve(vsFills, "product.ts"),
|
|
|
|
"vs/base/node/zip": path.resolve(vsFills, "zip.ts"),
|
2019-03-21 19:04:09 +00:00
|
|
|
"vszip": path.resolve(root, "lib/vscode/src/vs/base/node/zip.ts"),
|
2019-02-26 17:07:00 +00:00
|
|
|
"vs": path.resolve(root, "lib/vscode/src/vs"),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
resolveLoader: {
|
|
|
|
alias: {
|
|
|
|
"vs/css": path.resolve(vsFills, "css.js"),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
);
|