Skip to content

Commit 6e8add6

Browse files
authored
Split bundles for webview using webpack (microsoft#9804)
* Split bundles for webview using webpack * Add comments * Build index html files * Fixes to detection of modules used in bundles * Ignore more files from extension * Include some map files * Fixes
1 parent d9bebc9 commit 6e8add6

30 files changed

Lines changed: 396 additions & 231 deletions

.vscodeignore

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1-
!out/client/**/*.map
21
**/*.map
3-
!out/datascience-ui/**/*.map
2+
**/*.analyzer.html
3+
!out/datascience-ui/notebook/commons.initial.bundle.js.map
4+
!out/datascience-ui/notebook/interactiveWindow.js.map
5+
!out/datascience-ui/notebook/nativeEditor.js.map
6+
!out/datascience-ui/viewers/commons.initial.bundle.js.map
7+
!out/datascience-ui/viewers/dataExplorer.js.map
8+
!out/datascience-ui/viewers/plotViewer.js.map
49
*.vsix
510
.appveyor.yml
611
.editorconfig
@@ -25,7 +30,9 @@ package.datascience-ui.dependencies.json
2530
package-lock.json
2631
packageExtension.cmd
2732
pvsc-dev-ext.py
33+
pvsc.code-workspace
2834
PYTHON_INTERACTIVE_TROUBLESHOOTING.md
35+
requirements.in
2936
test.ipynb
3037
travis*.log
3138
tsconfig*.json
@@ -42,6 +49,8 @@ webpack.datascience-*.config.js
4249
.mocha-reporter/**
4350
.nvm/**
4451
.nyc_output
52+
.prettierrc.js
53+
.sonarcloud.properties
4554
.venv/**
4655
.vscode/**
4756
.vscode-test/**
@@ -59,8 +68,26 @@ images/**/*.png
5968
news/**
6069
node_modules/**
6170
obj/**
62-
out/client/**/*analyzer.html
71+
out/**/*.stats.json
72+
out/client/**/*.analyzer.html
6373
out/coverconfig.json
74+
out/datascience-ui/**/*.analyzer.html
75+
out/datascience-ui/common/**
76+
out/datascience-ui/**/*.js.LICENSE
77+
out/datascience-ui/data-explorer/**
78+
out/datascience-ui/datascience-ui/**
79+
out/datascience-ui/history-react/**
80+
out/datascience-ui/interactive-common/**
81+
out/datascience-ui/ipywidgets/**
82+
out/datascience-ui/native-editor/**
83+
out/datascience-ui/notebook/datascience-ui/**
84+
out/datascience-ui/notebook/ipywidgets/**
85+
out/datascience-ui/notebook/index.*.html
86+
out/datascience-ui/plot/**
87+
out/datascience-ui/react-common/**
88+
out/datascience-ui/viewers/datascience-ui/**
89+
out/datascience-ui/viewers/ipywidgets/**
90+
out/datascience-ui/viewers/index.*.html
6491
out/pythonFiles/**
6592
out/src/**
6693
out/test/**

build/webpack/common.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,15 @@ exports.nodeModulesToExternalize = [
4040
exports.nodeModulesToReplacePaths = [...exports.nodeModulesToExternalize];
4141
function getDefaultPlugins(name) {
4242
const plugins = [];
43-
if (!constants.isCI) {
44-
plugins.push(
45-
new webpack_bundle_analyzer.BundleAnalyzerPlugin({
46-
analyzerMode: 'static',
47-
reportFilename: `${name}.analyzer.html`
48-
})
49-
);
50-
}
43+
plugins.push(
44+
new webpack_bundle_analyzer.BundleAnalyzerPlugin({
45+
analyzerMode: 'static',
46+
reportFilename: `${name}.analyzer.html`,
47+
generateStatsFile: true,
48+
statsFilename: `${name}.stats.json`,
49+
openAnalyzer: false // Open file manually if you want to see it :)
50+
})
51+
);
5152
return plugins;
5253
}
5354
exports.getDefaultPlugins = getDefaultPlugins;

build/webpack/webpack.datascience-ui-dataExplorerChunked.config.js

Lines changed: 0 additions & 9 deletions
This file was deleted.

build/webpack/webpack.datascience-ui-interactiveWindow.config.js

Lines changed: 0 additions & 9 deletions
This file was deleted.

build/webpack/webpack.datascience-ui-interactiveWindowChunked.config.js

Lines changed: 0 additions & 9 deletions
This file was deleted.

build/webpack/webpack.datascience-ui-nativeEditor.config.js

Lines changed: 0 additions & 9 deletions
This file was deleted.

build/webpack/webpack.datascience-ui-nativeEditorChunked.config.js

Lines changed: 0 additions & 9 deletions
This file was deleted.

build/webpack/webpack.datascience-ui-plotViewer.config.js renamed to build/webpack/webpack.datascience-ui-notebooks.config.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,5 @@
33

44
'use strict';
55

6-
// Note to editors, if you change this file you have to restart compile-webviews.
7-
// It doesn't reload the config otherwise.
86
const builder = require('./webpack.datascience-ui.config.builder');
9-
module.exports = builder.plotViewerConfig;
7+
module.exports = [builder.notebooks];

build/webpack/webpack.datascience-ui-plotViewerChunked.config.js

Lines changed: 0 additions & 9 deletions
This file was deleted.

build/webpack/webpack.datascience-ui-dataExplorer.config.js renamed to build/webpack/webpack.datascience-ui-viewers.config.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,5 @@
33

44
'use strict';
55

6-
// Note to editors, if you change this file you have to restart compile-webviews.
7-
// It doesn't reload the config otherwise.
86
const builder = require('./webpack.datascience-ui.config.builder');
9-
module.exports = builder.dataExplorerConfig;
7+
module.exports = [builder.viewers];

0 commit comments

Comments
 (0)