mirror of
https://github.com/Microsoft/vscode
synced 2024-10-05 19:02:54 +00:00
shared webpack browser config: add WEBWORKER definition
This commit is contained in:
parent
d0a272d025
commit
94081f67b6
|
@ -8,20 +8,18 @@
|
|||
'use strict';
|
||||
const path = require('path');
|
||||
const withBrowserDefaults = require('../shared.webpack.config').browser;
|
||||
const webpack = require('webpack');
|
||||
|
||||
const config = withBrowserDefaults({
|
||||
context: __dirname,
|
||||
node: false,
|
||||
entry: {
|
||||
extension: './src/extension.ts',
|
||||
extension: './src/extension.ts'
|
||||
},
|
||||
resolve: {
|
||||
alias: {
|
||||
'node-fetch': path.resolve(__dirname, 'node_modules/node-fetch/browser.js'),
|
||||
},
|
||||
'node-fetch': path.resolve(__dirname, 'node_modules/node-fetch/browser.js')
|
||||
}
|
||||
}
|
||||
});
|
||||
config.plugins.push(new webpack.DefinePlugin({ WEBWORKER: JSON.stringify(true) }))
|
||||
|
||||
module.exports = config;
|
||||
|
|
|
@ -13,6 +13,7 @@ const fs = require('fs');
|
|||
const merge = require('merge-options');
|
||||
const CopyWebpackPlugin = require('copy-webpack-plugin');
|
||||
const { NLSBundlePlugin } = require('vscode-nls-dev/lib/webpack-bundler');
|
||||
const { DefinePlugin } = require('webpack');
|
||||
|
||||
function withNodeDefaults(/**@type WebpackConfig*/extConfig) {
|
||||
// Need to find the top-most `package.json` file
|
||||
|
@ -129,6 +130,7 @@ function withBrowserDefaults(/**@type WebpackConfig*/extConfig) {
|
|||
new CopyWebpackPlugin([
|
||||
{ from: 'src', to: '.', ignore: ['**/test/**', '*.ts'] }
|
||||
]),
|
||||
new DefinePlugin({ WEBWORKER: JSON.stringify(true) })
|
||||
]
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue