Archived
1
0

Fix extra CSS being included on the client

This commit is contained in:
Asher
2019-02-26 11:07:00 -06:00
parent 7b5871136b
commit 04e02bdb08
16 changed files with 281 additions and 291 deletions

View File

@ -3,7 +3,7 @@
"description": "VS Code implementation of the browser-based IDE client.",
"main": "src/index.ts",
"scripts": {
"build:bootstrap-fork": "../../node_modules/.bin/webpack --config ./webpack.config.bootstrap.js"
"build:bootstrap-fork": "UV_THREADPOOL_SIZE=100 node --max-old-space-size=32384 ../../node_modules/webpack/bin/webpack.js --config ./webpack.bootstrap.config.js"
},
"dependencies": {
"iconv-lite": "^0.4.24",

View File

@ -29,8 +29,6 @@ import { RawContextKey, IContextKeyService } from "vs/platform/contextkey/common
import { ServiceCollection } from "vs/platform/instantiation/common/serviceCollection";
import { URI } from "vs/base/common/uri";
import "vs/loader";
export class Workbench {
private readonly windowId = parseInt(new Date().toISOString().replace(/[-:.TZ]/g, ""), 10);
private _serviceCollection: ServiceCollection | undefined;

View File

@ -0,0 +1,69 @@
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"))({
typescriptCompilerOptions: {
target: "es5",
},
}), {
entry: path.join(root, "lib/vscode/src/bootstrap-fork.js"),
mode: "development",
output: {
chunkFilename: "[name].bundle.js",
path: path.resolve(__dirname, "out"),
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",
}],
}, {
test: /(\/vs\/code\/electron-main\/)|(\/test\/)|(OSSREADME\.json$)|(\.(test\.ts|test\.js|d\.ts|qwoff|node|html|txt|exe|wuff|md|sh|scpt|less)$)/,
use: [{
loader: "ignore-loader",
}],
}],
noParse: /\/test\/|\.test\.jsx?|\.test\.tsx?|tsconfig.+\.json$/,
},
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"),
"electron": path.join(vsFills, "stdioElectron.ts"),
"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"),
"vs/base/node/paths": path.resolve(vsFills, "paths.ts"),
"vs/platform/node/package": path.resolve(vsFills, "package.ts"),
"vs/platform/node/product": path.resolve(vsFills, "product.ts"),
"vs": path.resolve(root, "lib/vscode/src/vs"),
},
},
resolveLoader: {
alias: {
"vs/css": path.resolve(vsFills, "css.js"),
},
},
}
);

View File

@ -1,61 +0,0 @@
const path = require("path");
const webpack = require("webpack");
const root = path.resolve(__dirname, "../..");
const fills = path.join(root, "packages/ide/src/fill");
const vscodeFills = path.join(root, "packages/vscode/src/fill");
const merge = require("webpack-merge");
module.exports = (env) => {
return merge(require(path.join(root, "scripts/webpack.general.config.js"))({
typescriptCompilerOptions: {
target: "es5",
},
}), {
entry: path.join(root, "lib/vscode/src/bootstrap-fork.js"),
mode: "development",
target: "node",
output: {
chunkFilename: "[name].bundle.js",
path: path.resolve(__dirname, "./bin"),
publicPath: "/",
filename: "bootstrap-fork.js",
libraryTarget: "commonjs",
globalObject: "this",
},
module: {
rules: [{
// Ignore a bunch of file types we don't have loaders for. Also ignore
// test directories, some files with invalid JSON, and files we don't
// actually require but throw warnings or errors. This all seems to be a
// case of dynamic loading including things we won't require.
// This also results in the bundle being significantly smaller which
// makes uglify much faster.
test: /(\/vs\/code\/electron-main\/)|(\/test\/)|(OSSREADME\.json$)|(\.(test\.ts|test\.js|d\.ts|qwoff|node|html|txt|exe|wuff|md|sh|scpt|less)$)/,
use: ["ignore-loader"]
}],
},
resolve: {
alias: {
"gc-signals": path.join(fills, "empty.ts"),
"native-keymap": path.join(fills, "native-keymap.ts"),
"windows-process-tree": path.resolve(fills, "empty.ts"),
"node-pty": path.resolve(fills, "empty.ts"),
"electron": path.join(vscodeFills, "stdioElectron.ts"),
"native-watchdog": path.join(vscodeFills, "native-watchdog.ts"),
"vs/platform/node/product": path.resolve(vscodeFills, "product.ts"),
"vs/platform/node/package": path.resolve(vscodeFills, "package.ts"),
"vs/base/node/paths": path.resolve(vscodeFills, "paths.ts"),
"vs/base/common/amd": path.resolve(vscodeFills, "amd.ts"),
"vs": path.resolve(root, "lib/vscode/src/vs"),
},
},
resolveLoader: {
alias: {
"vs/css": path.resolve(vscodeFills, "css.js"),
},
},
});
};