mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-08 06:25:45 +01:00
added code splitting support for plugin bundles
This commit is contained in:
@@ -16,7 +16,7 @@ module.exports = function(mode) {
|
||||
return {
|
||||
context: root,
|
||||
entry: {
|
||||
[name]: packageJSON.main || "src/main/js/index.js"
|
||||
[name]: [path.resolve(__dirname, "webpack-public-path.js"), packageJSON.main || "src/main/js/index.js"]
|
||||
},
|
||||
mode,
|
||||
devtool: "source-map",
|
||||
@@ -68,6 +68,7 @@ module.exports = function(mode) {
|
||||
output: {
|
||||
path: path.join(root, "target", name + "-" + packageJSON.version, "webapp", "assets"),
|
||||
filename: "[name].bundle.js",
|
||||
chunkFilename: name + ".[name].chunk.js",
|
||||
library: name,
|
||||
libraryTarget: "amd"
|
||||
}
|
||||
|
||||
5
scm-ui/ui-scripts/src/webpack-public-path.js
Normal file
5
scm-ui/ui-scripts/src/webpack-public-path.js
Normal file
@@ -0,0 +1,5 @@
|
||||
/* global __webpack_public_path__ */
|
||||
// setup webpack public path:
|
||||
// https://stackoverflow.com/questions/39879680/example-of-setting-webpack-public-path-at-runtime
|
||||
// https://github.com/coryhouse/react-slingshot/pull/207/files
|
||||
__webpack_public_path__ = window.ctxPath + "/assets/";
|
||||
@@ -8,7 +8,11 @@ module.exports = [
|
||||
{
|
||||
context: root,
|
||||
entry: {
|
||||
webapp: ["./ui-webapp/src/webpack-public-path.ts", "./ui-styles/src/scm.scss", "./ui-webapp/src/index.tsx"]
|
||||
webapp: [
|
||||
path.resolve(__dirname, "webpack-public-path.js"),
|
||||
"./ui-styles/src/scm.scss",
|
||||
"./ui-webapp/src/index.tsx"
|
||||
]
|
||||
},
|
||||
devtool: "cheap-module-eval-source-map",
|
||||
target: "web",
|
||||
|
||||
Reference in New Issue
Block a user