|
| 1 | +const path = require("path"); |
| 2 | +const merge = require("webpack-merge"); |
| 3 | + |
| 4 | +const root = path.resolve(__dirname, "../.."); |
| 5 | +const fills = path.join(root, "packages/ide/src/fill"); |
| 6 | +const vsFills = path.join(root, "packages/vscode/src/fill"); |
| 7 | + |
| 8 | +module.exports = merge( |
| 9 | + require(path.join(root, "scripts/webpack.node.config.js"))({ |
| 10 | + typescriptCompilerOptions: { |
| 11 | + target: "es5", |
| 12 | + }, |
| 13 | + }), { |
| 14 | + entry: path.join(root, "lib/vscode/src/bootstrap-fork.js"), |
| 15 | + mode: "development", |
| 16 | + output: { |
| 17 | + chunkFilename: "[name].bundle.js", |
| 18 | + path: path.resolve(__dirname, "out"), |
| 19 | + publicPath: "/", |
| 20 | + filename: "bootstrap-fork.js", |
| 21 | + libraryTarget: "commonjs", |
| 22 | + globalObject: "this", |
| 23 | + }, |
| 24 | + // Due to the dynamic `require.context` we add to `loader.js` Webpack tries |
| 25 | + // to include way too much. We can modify what Webpack imports in this case |
| 26 | + // (I believe), but for now ignore some things. |
| 27 | + module: { |
| 28 | + rules: [{ |
| 29 | + test: /\.(txt|d\.ts|perf\.data\.js|jxs|scpt|exe|sh|less|html|s?css|qwoff|md|svg|png|ttf|woff|eot|woff2)$/, |
| 30 | + use: [{ |
| 31 | + loader: "ignore-loader", |
| 32 | + }], |
| 33 | + }, { |
| 34 | + test: /test|tsconfig/, |
| 35 | + use: [{ |
| 36 | + loader: "ignore-loader", |
| 37 | + }], |
| 38 | + }, { |
| 39 | + test: /(\/vs\/code\/electron-main\/)|(\/test\/)|(OSSREADME\.json$)|(\.(test\.ts|test\.js|d\.ts|qwoff|node|html|txt|exe|wuff|md|sh|scpt|less)$)/, |
| 40 | + use: [{ |
| 41 | + loader: "ignore-loader", |
| 42 | + }], |
| 43 | + }], |
| 44 | + noParse: /\/test\/|\.test\.jsx?|\.test\.tsx?|tsconfig.+\.json$/, |
| 45 | + }, |
| 46 | + resolve: { |
| 47 | + alias: { |
| 48 | + "gc-signals": path.join(fills, "empty.ts"), |
| 49 | + "node-pty": path.resolve(fills, "empty.ts"), |
| 50 | + "windows-mutex": path.resolve(fills, "empty.ts"), |
| 51 | + "windows-process-tree": path.resolve(fills, "empty.ts"), |
| 52 | + |
| 53 | + "electron": path.join(vsFills, "stdioElectron.ts"), |
| 54 | + "native-keymap": path.join(vsFills, "native-keymap.ts"), |
| 55 | + "native-watchdog": path.join(vsFills, "native-watchdog.ts"), |
| 56 | + "vs/base/common/amd": path.resolve(vsFills, "amd.ts"), |
| 57 | + "vs/base/node/paths": path.resolve(vsFills, "paths.ts"), |
| 58 | + "vs/platform/node/package": path.resolve(vsFills, "package.ts"), |
| 59 | + "vs/platform/node/product": path.resolve(vsFills, "product.ts"), |
| 60 | + "vs": path.resolve(root, "lib/vscode/src/vs"), |
| 61 | + }, |
| 62 | + }, |
| 63 | + resolveLoader: { |
| 64 | + alias: { |
| 65 | + "vs/css": path.resolve(vsFills, "css.js"), |
| 66 | + }, |
| 67 | + }, |
| 68 | + } |
| 69 | +); |
0 commit comments