break up extension-browser.webpack.config

This commit is contained in:
Martin Aeschlimann
2020-06-08 18:06:26 +02:00
parent 39456ea09d
commit bd57bd7078
4 changed files with 47 additions and 24 deletions

View File

@@ -0,0 +1,34 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
//@ts-check
'use strict';
const withDefaults = require('../../shared.webpack.config');
const path = require('path');
const webpack = require('webpack');
const vscodeNlsReplacement = new webpack.NormalModuleReplacementPlugin(
/vscode\-nls[\\/]lib[\\/]main\.js/,
path.join(__dirname, '../client/out/browser/vscodeNlsShim.js')
);
const serverConfig = withDefaults({
target: 'webworker',
context: __dirname,
entry: {
extension: './src/browser/cssServerMain.ts',
},
output: {
filename: 'cssServerMain.js',
path: path.join(__dirname, 'dist', 'browser'),
libraryTarget: 'var'
}
});
serverConfig.plugins[1] = vscodeNlsReplacement; // replace nls bundler
serverConfig.module.rules[0].use.shift(); // remove nls loader
module.exports = serverConfig;