2019-01-08 00:46:19 +00:00
|
|
|
const path = require("path");
|
|
|
|
const HtmlWebpackPlugin = require("html-webpack-plugin");
|
|
|
|
const { BundleAnalyzerPlugin } = require("webpack-bundle-analyzer");
|
|
|
|
const WriteFilePlugin = require("write-file-webpack-plugin");
|
|
|
|
const PreloadWebpackPlugin = require("preload-webpack-plugin");
|
2019-01-12 00:11:34 +00:00
|
|
|
const root = __dirname;
|
2019-01-14 20:58:34 +00:00
|
|
|
const fills = path.join(root, "packages", "ide", "src", "fill");
|
2019-01-12 00:11:34 +00:00
|
|
|
const vscodeFills = path.join(root, "packages", "vscode", "src", "fill");
|
|
|
|
|
2019-01-15 18:36:09 +00:00
|
|
|
const merge = require("webpack-merge");
|
|
|
|
|
|
|
|
module.exports = merge({
|
2019-01-14 23:19:29 +00:00
|
|
|
devtool: "eval",
|
2019-01-14 21:06:06 +00:00
|
|
|
entry: "./packages/web/src/index.ts",
|
2019-01-08 00:46:19 +00:00
|
|
|
output: {
|
|
|
|
chunkFilename: "[name]-[hash:6].bundle.js",
|
2019-01-12 00:11:34 +00:00
|
|
|
path: path.join(root, "dist"),
|
2019-01-08 00:46:19 +00:00
|
|
|
filename: "[hash:6].bundle.js",
|
|
|
|
},
|
|
|
|
resolve: {
|
|
|
|
alias: {
|
2019-01-12 00:11:34 +00:00
|
|
|
"native-keymap": path.join(vscodeFills, "native-keymap.ts"),
|
|
|
|
"node-pty": path.join(vscodeFills, "node-pty.ts"),
|
|
|
|
|
2019-01-14 20:58:34 +00:00
|
|
|
"gc-signals": path.join(fills, "empty.ts"),
|
|
|
|
"selenium-webdriver": path.join(fills, "empty.ts"),
|
|
|
|
"vscode": path.join(fills, "empty.ts"),
|
|
|
|
"vscode-fsevents": path.join(fills, "empty.ts"),
|
|
|
|
"vsda": path.join(fills, "empty.ts"),
|
|
|
|
"windows-foreground-love": path.join(fills, "empty.ts"),
|
|
|
|
"windows-mutex": path.join(fills, "empty.ts"),
|
|
|
|
"windows-process-tree": path.join(fills, "empty.ts"),
|
2019-01-08 00:46:19 +00:00
|
|
|
|
|
|
|
"crypto": "crypto-browserify",
|
|
|
|
"http": "http-browserify",
|
|
|
|
"os": "os-browserify",
|
2019-01-12 00:11:34 +00:00
|
|
|
|
2019-01-14 20:58:34 +00:00
|
|
|
"child_process": path.join(fills, "child_process.ts"),
|
|
|
|
"fs": path.join(fills, "fs.ts"),
|
|
|
|
"net": path.join(fills, "net.ts"),
|
|
|
|
"util": path.join(fills, "util.ts"),
|
2019-01-12 00:11:34 +00:00
|
|
|
|
2019-01-14 20:58:34 +00:00
|
|
|
"electron": path.join(fills, "electron.ts"),
|
2019-01-12 00:11:34 +00:00
|
|
|
|
|
|
|
"vs": path.join(root, "lib", "vscode", "src", "vs"),
|
2019-01-08 00:46:19 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
resolveLoader: {
|
|
|
|
alias: {
|
2019-01-12 00:11:34 +00:00
|
|
|
"vs/css": path.join(vscodeFills, "css.js"),
|
2019-01-08 00:46:19 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
new HtmlWebpackPlugin({
|
2019-01-14 21:06:06 +00:00
|
|
|
template: "packages/web/src/index.html",
|
2019-01-08 00:46:19 +00:00
|
|
|
}),
|
|
|
|
new PreloadWebpackPlugin({
|
|
|
|
rel: "preload",
|
|
|
|
as: "script",
|
|
|
|
}),
|
2019-01-15 18:36:09 +00:00
|
|
|
new WriteFilePlugin({
|
|
|
|
exitOnErrors: false,
|
2019-01-08 00:46:19 +00:00
|
|
|
}),
|
|
|
|
],
|
|
|
|
target: "web",
|
2019-01-15 18:36:09 +00:00
|
|
|
}, require("./scripts/webpack.general.config.js"));
|