Skip to content

Commit 16be2c9

Browse files
committed
used shared webpack-config for browser
1 parent 5e870a6 commit 16be2c9

21 files changed

+97
-184
lines changed

extensions/configuration-editing/extension-browser.webpack.config.js

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,15 @@
77

88
'use strict';
99

10-
const withDefaults = require('../shared.webpack.config');
11-
const path = require('path');
10+
const withBrowserDefaults = require('../shared.webpack.config').browser;
1211

13-
const clientConfig = withDefaults({
14-
target: 'webworker',
12+
module.exports = withBrowserDefaults({
1513
context: __dirname,
1614
entry: {
1715
extension: './src/configurationEditingMain.ts'
1816
},
1917
output: {
2018
filename: 'configurationEditingMain.js'
21-
},
22-
performance: {
23-
hints: false
24-
},
25-
resolve: {
26-
alias: {
27-
'vscode-nls': path.resolve(__dirname, '../../build/polyfills/vscode-nls.js')
28-
}
2919
}
3020
});
31-
clientConfig.module.rules[0].use.shift(); // remove nls loader
3221

33-
module.exports = clientConfig;

extensions/configuration-editing/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"onLanguage:jsonc"
1414
],
1515
"main": "./out/configurationEditingMain",
16-
"browser": "./dist/configurationEditingMain",
16+
"browser": "./dist/browser/configurationEditingMain",
1717
"scripts": {
1818
"compile": "gulp compile-extension:configuration-editing",
1919
"watch": "gulp watch-extension:configuration-editing"

extensions/css-language-features/extension-browser.webpack.config.js

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,16 @@
77

88
'use strict';
99

10-
const withDefaults = require('../shared.webpack.config');
10+
const withBrowserDefaults = require('../shared.webpack.config').browser;
1111
const path = require('path');
1212

13-
const clientConfig = withDefaults({
14-
target: 'webworker',
13+
module.exports = withBrowserDefaults({
1514
context: path.join(__dirname, 'client'),
1615
entry: {
1716
extension: './src/browser/cssClientMain.ts'
1817
},
1918
output: {
2019
filename: 'cssClientMain.js',
2120
path: path.join(__dirname, 'client', 'dist', 'browser')
22-
},
23-
performance: {
24-
hints: false
25-
},
26-
resolve: {
27-
alias: {
28-
'vscode-nls': path.resolve(__dirname, '../../build/polyfills/vscode-nls.js')
29-
}
3021
}
3122
});
32-
clientConfig.module.rules[0].use.shift(); // remove nls loader
33-
34-
module.exports = clientConfig;

extensions/css-language-features/server/extension-browser.webpack.config.js

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,10 @@
77

88
'use strict';
99

10-
const withDefaults = require('../../shared.webpack.config');
10+
const withBrowserDefaults = require('../../shared.webpack.config').browser;
1111
const path = require('path');
1212

13-
const serverConfig = withDefaults({
14-
target: 'webworker',
13+
module.exports = withBrowserDefaults({
1514
context: __dirname,
1615
entry: {
1716
extension: './src/browser/cssServerMain.ts',
@@ -20,16 +19,5 @@ const serverConfig = withDefaults({
2019
filename: 'cssServerMain.js',
2120
path: path.join(__dirname, 'dist', 'browser'),
2221
libraryTarget: 'var'
23-
},
24-
performance: {
25-
hints: false
26-
},
27-
resolve: {
28-
alias: {
29-
'vscode-nls': path.resolve(__dirname, '../../../build/polyfills/vscode-nls.js')
30-
}
3122
}
3223
});
33-
serverConfig.module.rules[0].use.shift(); // remove nls loader
34-
35-
module.exports = serverConfig;

extensions/html-language-features/extension-browser.webpack.config.js

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,16 @@
77

88
'use strict';
99

10-
const withDefaults = require('../shared.webpack.config');
10+
const withBrowserDefaults = require('../shared.webpack.config').browser;
1111
const path = require('path');
1212

13-
const clientConfig = withDefaults({
14-
target: 'webworker',
13+
module.exports = withBrowserDefaults({
1514
context: path.join(__dirname, 'client'),
1615
entry: {
1716
extension: './src/browser/htmlClientMain.ts'
1817
},
1918
output: {
2019
filename: 'htmlClientMain.js',
2120
path: path.join(__dirname, 'client', 'dist', 'browser')
22-
},
23-
performance: {
24-
hints: false
25-
},
26-
resolve: {
27-
alias: {
28-
'vscode-nls': path.resolve(__dirname, '../../build/polyfills/vscode-nls.js')
29-
}
3021
}
3122
});
32-
clientConfig.module.rules[0].use.shift(); // remove nls loader
33-
34-
module.exports = clientConfig;

extensions/html-language-features/server/extension-browser.webpack.config.js

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,36 +7,25 @@
77

88
'use strict';
99

10-
const withDefaults = require('../../shared.webpack.config');
10+
const withBrowserDefaults = require('../../shared.webpack.config').browser;
1111
const path = require('path');
1212

13-
const serverConfig = withDefaults({
14-
target: 'webworker',
13+
const serverConfig = withBrowserDefaults({
1514
context: __dirname,
1615
entry: {
1716
extension: './src/browser/htmlServerMain.ts',
18-
1917
},
2018
output: {
2119
filename: 'htmlServerMain.js',
2220
path: path.join(__dirname, 'dist', 'browser'),
2321
libraryTarget: 'var'
2422
},
25-
performance: {
26-
hints: false
27-
},
2823
optimization: {
2924
splitChunks: {
3025
chunks: "async"
3126
}
32-
},
33-
resolve: {
34-
alias: {
35-
'vscode-nls': path.resolve(__dirname, '../../../build/polyfills/vscode-nls.js')
36-
}
3727
}
3828
});
39-
serverConfig.module.rules[0].use.shift(); // remove nls loader
4029
serverConfig.module.noParse = /typescript\/lib\/typescript\.js/;
4130
serverConfig.module.rules.push({
4231
test: /javascriptLibs.ts$/,

extensions/image-preview/extension-browser.webpack.config.js

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,11 @@
77

88
'use strict';
99

10-
const withDefaults = require('../shared.webpack.config');
11-
const path = require('path');
10+
const withBrowserDefaults = require('../shared.webpack.config').browser;
1211

13-
const clientConfig = withDefaults({
12+
module.exports = withBrowserDefaults({
1413
context: __dirname,
15-
target: 'webworker',
1614
entry: {
1715
extension: './src/extension.ts'
1816
},
19-
resolve: {
20-
alias: {
21-
'vscode-extension-telemetry': path.resolve(__dirname, '../../build/polyfills/vscode-extension-telemetry.js'),
22-
'vscode-nls': path.resolve(__dirname, '../../build/polyfills/vscode-nls.js'),
23-
},
24-
}
2517
});
26-
27-
clientConfig.module.rules[0].use.shift(); // remove nls loader
28-
29-
module.exports = clientConfig;

extensions/image-preview/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"vscode": "^1.39.0"
1717
},
1818
"main": "./out/extension",
19-
"browser": "./dist/extension.js",
19+
"browser": "./dist/browser/extension.js",
2020
"categories": [
2121
"Other"
2222
],

extensions/json-language-features/extension-browser.webpack.config.js

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77

88
'use strict';
99

10-
const withDefaults = require('../shared.webpack.config');
10+
const withBrowserDefaults = require('../shared.webpack.config').browser;
1111
const path = require('path');
1212

13-
const clientConfig = withDefaults({
13+
module.exports = withBrowserDefaults({
1414
target: 'webworker',
1515
context: path.join(__dirname, 'client'),
1616
entry: {
@@ -19,16 +19,5 @@ const clientConfig = withDefaults({
1919
output: {
2020
filename: 'jsonClientMain.js',
2121
path: path.join(__dirname, 'client', 'dist', 'browser')
22-
},
23-
performance: {
24-
hints: false
25-
},
26-
resolve: {
27-
alias: {
28-
'vscode-nls': path.resolve(__dirname, '../../build/polyfills/vscode-nls.js')
29-
}
3022
}
3123
});
32-
clientConfig.module.rules[0].use.shift(); // remove nls loader
33-
34-
module.exports = clientConfig;

extensions/json-language-features/server/extension-browser.webpack.config.js

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,10 @@
77

88
'use strict';
99

10-
const withDefaults = require('../../shared.webpack.config');
10+
const withBrowserDefaults = require('../../shared.webpack.config').browser;
1111
const path = require('path');
1212

13-
const serverConfig = withDefaults({
14-
target: 'webworker',
13+
module.exports = withBrowserDefaults({
1514
context: __dirname,
1615
entry: {
1716
extension: './src/browser/jsonServerMain.ts',
@@ -20,16 +19,5 @@ const serverConfig = withDefaults({
2019
filename: 'jsonServerMain.js',
2120
path: path.join(__dirname, 'dist', 'browser'),
2221
libraryTarget: 'var'
23-
},
24-
performance: {
25-
hints: false
26-
},
27-
resolve: {
28-
alias: {
29-
'vscode-nls': path.resolve(__dirname, '../../../build/polyfills/vscode-nls.js')
30-
}
3122
}
3223
});
33-
serverConfig.module.rules[0].use.shift(); // remove nls loader
34-
35-
module.exports = serverConfig;

0 commit comments

Comments
 (0)