@trackunit/iris-app-webpack-plugin 0.0.171 → 0.0.173
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
## [0.0.173](https://github.com/Trackunit/manager/compare/iris-app-webpack-plugin/0.0.172...iris-app-webpack-plugin/0.0.173) (2024-02-08)
|
|
6
|
+
|
|
7
|
+
## [0.0.172](https://github.com/Trackunit/manager/compare/iris-app-webpack-plugin/0.0.171...iris-app-webpack-plugin/0.0.172) (2024-02-08)
|
|
8
|
+
|
|
5
9
|
## [0.0.171](https://github.com/Trackunit/manager/compare/iris-app-webpack-plugin/0.0.170...iris-app-webpack-plugin/0.0.171) (2024-02-07)
|
|
6
10
|
|
|
7
11
|
### Dependency Updates
|
package/package.json
CHANGED
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.TrackunitIrisAppWebpackPlugin = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const iris_app_api_1 = require("@trackunit/iris-app-api");
|
|
6
|
+
const crypto_1 = require("crypto");
|
|
6
7
|
const csp_header_1 = require("csp-header");
|
|
7
8
|
const fs = tslib_1.__importStar(require("fs"));
|
|
8
9
|
const path = tslib_1.__importStar(require("path"));
|
|
@@ -52,6 +53,7 @@ class TrackunitIrisAppWebpackPlugin {
|
|
|
52
53
|
// to the compilation process on an earlier stage.
|
|
53
54
|
compiler.hooks.thisCompilation.tap(pluginName, (compilation) => {
|
|
54
55
|
// Tapping to the assets processing pipeline on a specific stage.
|
|
56
|
+
compilation.contextDependencies.add(this.options.appDir);
|
|
55
57
|
compilation.hooks.processAssets.tap({
|
|
56
58
|
name: pluginName,
|
|
57
59
|
// Using one of the later asset processing stages to ensure
|
|
@@ -155,9 +157,19 @@ class TrackunitIrisAppWebpackPlugin {
|
|
|
155
157
|
compilation.emitAsset("manifest.json", new RawSource(JSON.stringify(manifestJson, null, 2)));
|
|
156
158
|
const packageJson = fs.readFileSync(`${this.options.appDir}/package.json`, "utf8");
|
|
157
159
|
compilation.emitAsset("package.json", new RawSource(packageJson));
|
|
158
|
-
const
|
|
160
|
+
const scopeAndModuleNonce = (0, crypto_1.randomBytes)(16).toString("base64");
|
|
161
|
+
const cspInput = (0, iris_app_api_1.irisAppCspInput)(manifest.validDomains, undefined, `'nonce-${scopeAndModuleNonce}'`);
|
|
162
|
+
cspInput.directives["connect-src"].push("ws://localhost:8097/");
|
|
163
|
+
const csp = (0, csp_header_1.getCSP)(cspInput);
|
|
159
164
|
let html = indexContents.replace("{{cspContent}}", csp);
|
|
165
|
+
html = html.replace("{{nonce}}", scopeAndModuleNonce);
|
|
160
166
|
html = html.replace("{{scope}}", JSON.parse(packageJson).name);
|
|
167
|
+
if (manifestJson.scopes) {
|
|
168
|
+
html = html.replace("{{manifestScopes}}", JSON.stringify(manifestJson.scopes));
|
|
169
|
+
}
|
|
170
|
+
else {
|
|
171
|
+
html = html.replace("{{manifestScopes}}", "[]");
|
|
172
|
+
}
|
|
161
173
|
// Adding new asset to the compilation, so it would be automatically
|
|
162
174
|
// generated by the webpack in the output directory.
|
|
163
175
|
compilation.emitAsset("index.html", new RawSource(html));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TrackunitIrisAppWebpackPlugin.js","sourceRoot":"","sources":["../../../../../../libs/iris-app-sdk/iris-app-webpack-plugin/src/lib/TrackunitIrisAppWebpackPlugin.ts"],"names":[],"mappings":";;;;AAAA,0DAAuH;AACvH,2CAAoC;AACpC,+CAAyB;AACzB,mDAA6B;AAS7B,MAAM,gBAAgB,GAAG,CAAC,MAA0D,EAA4B,EAAE;IAChH,OAAO,CAAC,CAAC,CAAC,MAA2B,aAA3B,MAAM,uBAAN,MAAM,CAAuB,GAA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AC,gBAAgB,EAAE,GAAG,CAAC,CAAC;gBACxD,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,CAAC;gBAC/D,oEAAoE;gBACpE,oDAAoD;gBACpD,WAAW,CAAC,SAAS,CAAC,YAAY,EAAE,IAAI,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;YAC3D,CAAC,CAAA,CACF,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AA3LD,sEA2LC","sourcesContent":["import { irisAppCspInput, IrisAppManifest, languageKeys, TranslationKey, Translations } from \"@trackunit/iris-app-api\";\nimport { getCSP } from \"csp-header\";\nimport * as fs from \"fs\";\nimport * as path from \"path\";\nimport * as wp from \"webpack\";\n\ninterface ITrackunitIrisAppWebpackPluginOptions {\n nxRootDir: string;\n appDir: string;\n manifest: IrisAppManifest;\n}\n\nconst isTranslationKey = (object: string | Translations | TranslationKey | undefined): object is TranslationKey => {\n return !!(object as { key?: string })?.key;\n};\n\nconst RESET = \"\\x1b[0m\";\nconst GREEN = \"\\x1b[32m\";\n/**\n * Webpack plugin that generates a manifest.json file\n */\nexport class TrackunitIrisAppWebpackPlugin {\n /**\n * @param options - Plugin options\n */\n public constructor(private options: ITrackunitIrisAppWebpackPluginOptions) {}\n\n /**\n Webpack plugin for generating a Markdown file from app manifest and index HTML file.\n *\n @class\n @public\n @param {object} options - Plugin options object\n @param {string} options.appDir - Directory path where the app resides\n @param {object} options.manifest - Object containing the app's manifest\n */\n public apply(compiler: wp.Compiler) {\n const pluginName = TrackunitIrisAppWebpackPlugin.name;\n\n // webpack module instance can be accessed from the compiler object,\n // this ensures that correct version of the module is used\n // (do not require/import the webpack or any symbols from it directly).\n const { webpack } = compiler;\n\n // Compilation object gives us reference to some useful constants.\n const { Compilation } = webpack;\n\n // RawSource is one of the \"sources\" classes that should be used\n // to represent asset sources in compilation.\n const { RawSource } = webpack.sources;\n\n compiler.hooks.done.tap(\"AfterBuildPlugin\", stats => {\n if (!stats.hasErrors()) {\n setTimeout(() => {\n console.log(\n GREEN,\n \"\\n✨ Iris App is now started, check it out ✨\\nhttps://new.manager.trackunit.com/iris-sdk-portal/main#runLocal\\n\",\n RESET\n );\n }, 0);\n }\n });\n\n // Tapping to the \"thisCompilation\" hook in order to further tap\n // to the compilation process on an earlier stage.\n compiler.hooks.thisCompilation.tap(pluginName, (compilation: wp.Compilation) => {\n // Tapping to the assets processing pipeline on a specific stage.\n compilation.hooks.processAssets.tap(\n {\n name: pluginName,\n\n // Using one of the later asset processing stages to ensure\n // that all assets were already added to the compilation by other plugins.\n stage: Compilation.PROCESS_ASSETS_STAGE_DERIVED,\n },\n async assets => {\n // \"assets\" is an object that contains all assets\n // in the compilation, the keys of the object are pathnames of the assets\n // and the values are file sources.\n\n // Iterating over all the assets and\n // generating content for our Markdown file.\n if (!this.options?.manifest) {\n throw Error(\"you must provide a app manifest\");\n }\n const manifest = this.options.manifest;\n const indexContents = fs.readFileSync(path.join(__dirname, \"index.html\"), \"utf8\");\n\n const manifestJson = this.options.manifest;\n manifestJson.extensions = this.options.manifest.extensions;\n\n this.options.manifest.extensions?.forEach(extension => {\n const translationKey =\n extension.type !== \"IRIS_APP_SETTINGS_EXTENSION\" &&\n extension.type !== \"WIDGET_EXTENSION\" &&\n extension.menuItem &&\n extension.menuItem.name;\n\n if (translationKey) {\n if (isTranslationKey(translationKey)) {\n const menuItemName = translationKey;\n const menuItemNameKey = menuItemName.key;\n\n languageKeys.forEach(langugageCode => {\n const translationFilePath = path.join(\n extension.sourceRoot,\n \"locales\",\n langugageCode,\n \"translation.json\"\n );\n if (fs.existsSync(translationFilePath)) {\n const translations = JSON.parse(fs.readFileSync(translationFilePath, \"utf8\"));\n //@ts-ignore - suppressImplicitAnyIndexErrors\n // Here we substitute the translation key with the actual translation\n extension.menuItem.name[langugageCode] = translations[menuItemNameKey];\n }\n });\n delete (menuItemName as { key?: string }).key;\n }\n }\n const headerTranslationKey =\n extension.type === \"WIDGET_EXTENSION\" && extension.header && extension.header.name;\n if (headerTranslationKey) {\n if (isTranslationKey(headerTranslationKey)) {\n const menuItemName = headerTranslationKey;\n const menuItemNameKey = menuItemName.key;\n\n languageKeys.forEach(langugageCode => {\n const translationFilePath = path.join(\n extension.sourceRoot,\n \"locales\",\n langugageCode,\n \"translation.json\"\n );\n if (fs.existsSync(translationFilePath)) {\n const translations = JSON.parse(fs.readFileSync(translationFilePath, \"utf8\"));\n //@ts-ignore - suppressImplicitAnyIndexErrors\n // Here we substitute the translation key with the actual translation\n extension.header.name[langugageCode] = translations[menuItemNameKey];\n }\n });\n delete (menuItemName as { key?: string }).key;\n }\n }\n\n if (extension.type === \"REPORT_EXTENSION\" && isTranslationKey(extension.menuItem?.description)) {\n const description = extension.menuItem.description;\n const menuItemDescriptionKey = description.key;\n\n languageKeys.forEach(langugageCode => {\n const translationFilePath = path.join(\n extension.sourceRoot,\n \"locales\",\n langugageCode,\n \"translation.json\"\n );\n if (fs.existsSync(translationFilePath)) {\n const translations = JSON.parse(fs.readFileSync(translationFilePath, \"utf8\"));\n //@ts-ignore - suppressImplicitAnyIndexErrors\n // Here we substitute the translation key with the actual translation\n extension.menuItem.description[langugageCode] = translations[menuItemDescriptionKey];\n }\n });\n delete (description as { key?: string }).key;\n }\n if (extension.type === \"ASSET_HOME_EXTENSION\" || extension.type === \"FLEET_EXTENSION\") {\n if (extension.conditions?.brand) {\n if (Array.isArray(extension.conditions.brand)) {\n extension.conditions.brand.forEach(brand => {\n if (typeof brand !== \"string\") {\n brand.pattern = brand.pattern.toString();\n }\n });\n } else if (typeof extension.conditions.brand !== \"string\") {\n extension.conditions.brand.pattern = extension.conditions.brand.pattern.toString();\n }\n }\n if (extension.conditions?.model) {\n if (Array.isArray(extension.conditions.model)) {\n extension.conditions.model.forEach(model => {\n if (typeof model !== \"string\") {\n model.pattern = model.pattern.toString();\n }\n });\n } else if (typeof extension.conditions.model !== \"string\") {\n extension.conditions.model.pattern = extension.conditions.model.pattern.toString();\n }\n }\n }\n });\n\n manifestJson.extensions = this.options.manifest.extensions;\n compilation.emitAsset(\"manifest.json\", new RawSource(JSON.stringify(manifestJson, null, 2)));\n\n const packageJson = fs.readFileSync(`${this.options.appDir}/package.json`, \"utf8\");\n compilation.emitAsset(\"package.json\", new RawSource(packageJson));\n\n const csp = getCSP(irisAppCspInput(manifest.validDomains));\n\n let html = indexContents.replace(\"{{cspContent}}\", csp);\n html = html.replace(\"{{scope}}\", JSON.parse(packageJson).name);\n // Adding new asset to the compilation, so it would be automatically\n // generated by the webpack in the output directory.\n compilation.emitAsset(\"index.html\", new RawSource(html));\n }\n );\n });\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"TrackunitIrisAppWebpackPlugin.js","sourceRoot":"","sources":["../../../../../../libs/iris-app-sdk/iris-app-webpack-plugin/src/lib/TrackunitIrisAppWebpackPlugin.ts"],"names":[],"mappings":";;;;AAAA,0DAAuH;AACvH,mCAAqC;AACrC,2CAAoC;AACpC,+CAAyB;AACzB,mDAA6B;AAS7B,MAAM,gBAAgB,GAAG,CAAC,MAA0D,EAA4B,EAAE;IAChH,OAAO,CAAC,CAAC,CAAC,MAA2B,aAA3B,MAAM,uBAAN,MAAM,CAAuB,GAAG,CAAA,CAAC;AAC7C,CAAC,CAAC;AAEF,MAAM,KAAK,GAAG,SAAS,CAAC;AACxB,MAAM,KAAK,GAAG,UAAU,CAAC;AACzB;;GAEG;AACH,MAAa,6BAA6B;IACxC;;OAEG;IACH,YAA2B,OAA8C;QAA9C,YAAO,GAAP,OAAO,CAAuC;IAAG,CAAC;IAE7E;;;;;;;;OAQG;IACI,KAAK,CAAC,QAAqB;QAChC,MAAM,UAAU,GAAG,6BAA6B,CAAC,IAAI,CAAC;QAEtD,oEAAoE;QACpE,0DAA0D;QAC1D,uEAAuE;QACvE,MAAM,EAAE,OAAO,EAAE,GAAG,QAAQ,CAAC;QAE7B,kEAAkE;QAClE,MAAM,E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E,mBAAmB,CAAC,CAAC;gBAEtD,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,CAAC;gBAC/D,IAAI,YAAY,CAAC,MAAM,EAAE;oBACvB,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,oBAAoB,EAAE,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC;iBAChF;qBAAM;oBACL,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,oBAAoB,EAAE,IAAI,CAAC,CAAC;iBACjD;gBACD,oEAAoE;gBACpE,oDAAoD;gBACpD,WAAW,CAAC,SAAS,CAAC,YAAY,EAAE,IAAI,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;YAC3D,CAAC,CAAA,CACF,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAvMD,sEAuMC","sourcesContent":["import { irisAppCspInput, IrisAppManifest, languageKeys, TranslationKey, Translations } from \"@trackunit/iris-app-api\";\nimport { randomBytes } from \"crypto\";\nimport { getCSP } from \"csp-header\";\nimport * as fs from \"fs\";\nimport * as path from \"path\";\nimport * as wp from \"webpack\";\n\ninterface ITrackunitIrisAppWebpackPluginOptions {\n nxRootDir: string;\n appDir: string;\n manifest: IrisAppManifest;\n}\n\nconst isTranslationKey = (object: string | Translations | TranslationKey | undefined): object is TranslationKey => {\n return !!(object as { key?: string })?.key;\n};\n\nconst RESET = \"\\x1b[0m\";\nconst GREEN = \"\\x1b[32m\";\n/**\n * Webpack plugin that generates a manifest.json file\n */\nexport class TrackunitIrisAppWebpackPlugin {\n /**\n * @param options - Plugin options\n */\n public constructor(private options: ITrackunitIrisAppWebpackPluginOptions) {}\n\n /**\n Webpack plugin for generating a Markdown file from app manifest and index HTML file.\n *\n @class\n @public\n @param {object} options - Plugin options object\n @param {string} options.appDir - Directory path where the app resides\n @param {object} options.manifest - Object containing the app's manifest\n */\n public apply(compiler: wp.Compiler) {\n const pluginName = TrackunitIrisAppWebpackPlugin.name;\n\n // webpack module instance can be accessed from the compiler object,\n // this ensures that correct version of the module is used\n // (do not require/import the webpack or any symbols from it directly).\n const { webpack } = compiler;\n\n // Compilation object gives us reference to some useful constants.\n const { Compilation } = webpack;\n\n // RawSource is one of the \"sources\" classes that should be used\n // to represent asset sources in compilation.\n const { RawSource } = webpack.sources;\n\n compiler.hooks.done.tap(\"AfterBuildPlugin\", stats => {\n if (!stats.hasErrors()) {\n setTimeout(() => {\n console.log(\n GREEN,\n \"\\n✨ Iris App is now started, check it out ✨\\nhttps://new.manager.trackunit.com/iris-sdk-portal/main#runLocal\\n\",\n RESET\n );\n }, 0);\n }\n });\n\n // Tapping to the \"thisCompilation\" hook in order to further tap\n // to the compilation process on an earlier stage.\n compiler.hooks.thisCompilation.tap(pluginName, (compilation: wp.Compilation) => {\n // Tapping to the assets processing pipeline on a specific stage.\n compilation.contextDependencies.add(this.options.appDir);\n compilation.hooks.processAssets.tap(\n {\n name: pluginName,\n\n // Using one of the later asset processing stages to ensure\n // that all assets were already added to the compilation by other plugins.\n stage: Compilation.PROCESS_ASSETS_STAGE_DERIVED,\n },\n async assets => {\n // \"assets\" is an object that contains all assets\n // in the compilation, the keys of the object are pathnames of the assets\n // and the values are file sources.\n\n // Iterating over all the assets and\n // generating content for our Markdown file.\n if (!this.options?.manifest) {\n throw Error(\"you must provide a app manifest\");\n }\n const manifest = this.options.manifest;\n const indexContents = fs.readFileSync(path.join(__dirname, \"index.html\"), \"utf8\");\n\n const manifestJson = this.options.manifest;\n manifestJson.extensions = this.options.manifest.extensions;\n\n this.options.manifest.extensions?.forEach(extension => {\n const translationKey =\n extension.type !== \"IRIS_APP_SETTINGS_EXTENSION\" &&\n extension.type !== \"WIDGET_EXTENSION\" &&\n extension.menuItem &&\n extension.menuItem.name;\n\n if (translationKey) {\n if (isTranslationKey(translationKey)) {\n const menuItemName = translationKey;\n const menuItemNameKey = menuItemName.key;\n\n languageKeys.forEach(langugageCode => {\n const translationFilePath = path.join(\n extension.sourceRoot,\n \"locales\",\n langugageCode,\n \"translation.json\"\n );\n if (fs.existsSync(translationFilePath)) {\n const translations = JSON.parse(fs.readFileSync(translationFilePath, \"utf8\"));\n //@ts-ignore - suppressImplicitAnyIndexErrors\n // Here we substitute the translation key with the actual translation\n extension.menuItem.name[langugageCode] = translations[menuItemNameKey];\n }\n });\n delete (menuItemName as { key?: string }).key;\n }\n }\n const headerTranslationKey =\n extension.type === \"WIDGET_EXTENSION\" && extension.header && extension.header.name;\n if (headerTranslationKey) {\n if (isTranslationKey(headerTranslationKey)) {\n const menuItemName = headerTranslationKey;\n const menuItemNameKey = menuItemName.key;\n\n languageKeys.forEach(langugageCode => {\n const translationFilePath = path.join(\n extension.sourceRoot,\n \"locales\",\n langugageCode,\n \"translation.json\"\n );\n if (fs.existsSync(translationFilePath)) {\n const translations = JSON.parse(fs.readFileSync(translationFilePath, \"utf8\"));\n //@ts-ignore - suppressImplicitAnyIndexErrors\n // Here we substitute the translation key with the actual translation\n extension.header.name[langugageCode] = translations[menuItemNameKey];\n }\n });\n delete (menuItemName as { key?: string }).key;\n }\n }\n\n if (extension.type === \"REPORT_EXTENSION\" && isTranslationKey(extension.menuItem?.description)) {\n const description = extension.menuItem.description;\n const menuItemDescriptionKey = description.key;\n\n languageKeys.forEach(langugageCode => {\n const translationFilePath = path.join(\n extension.sourceRoot,\n \"locales\",\n langugageCode,\n \"translation.json\"\n );\n if (fs.existsSync(translationFilePath)) {\n const translations = JSON.parse(fs.readFileSync(translationFilePath, \"utf8\"));\n //@ts-ignore - suppressImplicitAnyIndexErrors\n // Here we substitute the translation key with the actual translation\n extension.menuItem.description[langugageCode] = translations[menuItemDescriptionKey];\n }\n });\n delete (description as { key?: string }).key;\n }\n if (extension.type === \"ASSET_HOME_EXTENSION\" || extension.type === \"FLEET_EXTENSION\") {\n if (extension.conditions?.brand) {\n if (Array.isArray(extension.conditions.brand)) {\n extension.conditions.brand.forEach(brand => {\n if (typeof brand !== \"string\") {\n brand.pattern = brand.pattern.toString();\n }\n });\n } else if (typeof extension.conditions.brand !== \"string\") {\n extension.conditions.brand.pattern = extension.conditions.brand.pattern.toString();\n }\n }\n if (extension.conditions?.model) {\n if (Array.isArray(extension.conditions.model)) {\n extension.conditions.model.forEach(model => {\n if (typeof model !== \"string\") {\n model.pattern = model.pattern.toString();\n }\n });\n } else if (typeof extension.conditions.model !== \"string\") {\n extension.conditions.model.pattern = extension.conditions.model.pattern.toString();\n }\n }\n }\n });\n\n manifestJson.extensions = this.options.manifest.extensions;\n compilation.emitAsset(\"manifest.json\", new RawSource(JSON.stringify(manifestJson, null, 2)));\n\n const packageJson = fs.readFileSync(`${this.options.appDir}/package.json`, \"utf8\");\n compilation.emitAsset(\"package.json\", new RawSource(packageJson));\n\n const scopeAndModuleNonce = randomBytes(16).toString(\"base64\");\n\n const cspInput = irisAppCspInput(manifest.validDomains, undefined, `'nonce-${scopeAndModuleNonce}'`);\n cspInput.directives[\"connect-src\"].push(\"ws://localhost:8097/\");\n const csp = getCSP(cspInput);\n let html = indexContents.replace(\"{{cspContent}}\", csp);\n\n html = html.replace(\"{{nonce}}\", scopeAndModuleNonce);\n\n html = html.replace(\"{{scope}}\", JSON.parse(packageJson).name);\n if (manifestJson.scopes) {\n html = html.replace(\"{{manifestScopes}}\", JSON.stringify(manifestJson.scopes));\n } else {\n html = html.replace(\"{{manifestScopes}}\", \"[]\");\n }\n // Adding new asset to the compilation, so it would be automatically\n // generated by the webpack in the output directory.\n compilation.emitAsset(\"index.html\", new RawSource(html));\n }\n );\n });\n }\n}\n"]}
|
package/src/lib/index.html
CHANGED
|
@@ -3,11 +3,13 @@
|
|
|
3
3
|
<script>
|
|
4
4
|
module = location.pathname.split('/')[1];
|
|
5
5
|
scope = "{{scope}}";
|
|
6
|
+
manifestScopes = {{manifestScopes}};
|
|
6
7
|
</script>
|
|
7
8
|
<base id="baseHref" href="/"></base>
|
|
8
9
|
<script src="/remoteEntry.js"></script>
|
|
9
10
|
<script src="/tileloader.js"></script>
|
|
10
11
|
<meta http-equiv="Content-Security-Policy" content="{{cspContent}}">
|
|
12
|
+
<script nonce="{{nonce}}" src="http://localhost:8097"></script>
|
|
11
13
|
</head>
|
|
12
14
|
<body class="@container" style="margin: 0px; overflow: auto;">
|
|
13
15
|
<div id="single-spa-application:app" style="height: 100dvh">
|