add client/server browser parts

This commit is contained in:
Martin Aeschlimann
2020-05-27 22:35:37 +02:00
parent 90861d4924
commit 3ed67bc863
10 changed files with 242 additions and 62 deletions

View File

@@ -9,15 +9,40 @@
const withDefaults = require('../shared.webpack.config');
const path = require('path');
const webpack = require('webpack');
module.exports = withDefaults({
const vscodeNlsReplacement = new webpack.NormalModuleReplacementPlugin(
/vscode\-nls\/lib\/main\.js/,
path.join(__dirname, 'client/out/browser/vscodeNlsShim.js')
);
const clientConfig = withDefaults({
target: 'webworker',
context: path.join(__dirname, 'client'),
entry: {
extension: './src/browser/cssClientBrowserMain.ts',
extension: './src/browser/cssClientMain.ts'
},
output: {
filename: 'cssClientBrowserMain.js',
filename: 'cssClientMain.js',
path: path.join(__dirname, 'client', 'dist', 'browser')
}
});
clientConfig.plugins[1] = vscodeNlsReplacement; // replace nls bundler
clientConfig.module.rules[0].use.shift(); // remove nls loader
const serverConfig = withDefaults({
target: 'webworker',
context: path.join(__dirname, 'server'),
entry: {
extension: './src/browser/cssServerMain.ts',
},
output: {
filename: 'cssServerMain.js',
path: path.join(__dirname, 'server', 'dist', 'browser'),
libraryTarget: 'var'
}
});
serverConfig.plugins[1] = vscodeNlsReplacement; // replace nls bundler
serverConfig.module.rules[0].use.shift(); // remove nls loader
module.exports = [clientConfig, serverConfig];