How the packages are built and assembled by webpack into the single dist/ folder that GraphDB serves.
index.html, plugins, translations, copied packages.publicPath, the dev server.npm run build (root) runs in two phases:
scripts/build.sh builds each package with its own toolchain: packages/api, packages/shared-components
(Stencil) and packages/workbench (Angular). Each writes to its own dist/.postbuild runs webpack --config=webpack.config.prod.js, which bundles root-config and legacy-workbench
and assembles everything into the root dist/.npm run build-dev does the same with webpack.config.dev.js.
The configuration is split into webpack.config.common.js (shared) and webpack.config.prod.js /
webpack.config.dev.js, merged with webpack-merge on top of webpack-config-single-spa.
main (packages/root-config/src/ontotext-root-config.ts, the single-spa root) and
legacyWorkbench (packages/legacy-workbench/src/app.js). @ontotext/workbench-api is an external, loaded through
the import map.index.html is generated by HtmlWebpackPlugin from packages/root-config/src/index.ejs, which receives the
bundle names, the build version and the CSP source lists.plugins.js is the concatenation of every packages/legacy-workbench/src/**/plugin.js
(webpack-merge-and-include-globally). index.ejs loads it after root-config starts. See
Plugin system.MergeI18nPlugin (webpack/merge-i18n-plugin.js) merges every packages/*/src/assets/i18n/*.json
into dist/assets/i18n/. See i18n.MergeJsonPlugin merges the packages’ license-checker.json reports into one.CopyPlugin): assets/, the root-config and shared-components assets, root-config and legacy CSS,
legacy libraries, and the external plugins from graphdb-workbench-plugins into plugins/. The production config also
copies packages/api/dist → api/, packages/workbench/dist → workbench/ and packages/shared-components/dist →
shared-components/.string-replace-loader for the [AIV]{version}[/AIV] placeholder, LESS/SCSS/CSS
loaders, and expose-loader for jquery and d3, which legacy libraries expect as globals.If a new top-level folder is published in dist/, it must also be allowed in the backend’s Spring Security
configuration (see CI).
webpack.config.prod.js): file names carry a [contenthash] for cache busting, CSS is extracted
and minified, and publicPath is ./ so the app works behind a context path. CleanWebpackPlugin empties dist/
first.webpack.config.dev.js): source maps, single-spa.dev.js, and webpack serve on port 9000
(npm run start-root, part of npm run start). The dev server proxies the backend on localhost:7200 and serves
wb-plugins/ under /plugins.See also: Developers Guide