@hitachivantara/app-shell-vite-plugin 0.16.1 → 0.17.0
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.
|
@@ -3,6 +3,7 @@ import type { HvAppShellConfig } from "@hitachivantara/app-shell-shared";
|
|
|
3
3
|
/**
|
|
4
4
|
* Add the <BASE> tag at index.html file. Tag value is obtained by the main app ({@link #getMainApp}) baseUrl ({@link #getPublicPath})‘
|
|
5
5
|
* @param appShellConfig The app shell configuration.
|
|
6
|
+
* @param generateEmptyShell Flag that controls if an empty app shell application is created with tags instead of final values
|
|
6
7
|
*/
|
|
7
8
|
export default function generateBaseTag(appShellConfig: HvAppShellConfig, generateEmptyShell: boolean): PluginOption;
|
|
8
9
|
//# sourceMappingURL=vite-generate-base-plugin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vite-generate-base-plugin.d.ts","sourceRoot":"","sources":["../src/vite-generate-base-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AAEzC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAIzE
|
|
1
|
+
{"version":3,"file":"vite-generate-base-plugin.d.ts","sourceRoot":"","sources":["../src/vite-generate-base-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AAEzC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAIzE;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CACrC,cAAc,EAAE,gBAAgB,EAChC,kBAAkB,EAAE,OAAO,GAC1B,YAAY,CAyCd"}
|
|
@@ -2,6 +2,7 @@ import { getPublicPath } from "./config-utils.js";
|
|
|
2
2
|
/**
|
|
3
3
|
* Add the <BASE> tag at index.html file. Tag value is obtained by the main app ({@link #getMainApp}) baseUrl ({@link #getPublicPath})‘
|
|
4
4
|
* @param appShellConfig The app shell configuration.
|
|
5
|
+
* @param generateEmptyShell Flag that controls if an empty app shell application is created with tags instead of final values
|
|
5
6
|
*/
|
|
6
7
|
export default function generateBaseTag(appShellConfig, generateEmptyShell) {
|
|
7
8
|
const publicPath = getPublicPath(appShellConfig);
|
|
@@ -23,6 +24,15 @@ export default function generateBaseTag(appShellConfig, generateEmptyShell) {
|
|
|
23
24
|
href: generateEmptyShell ? "%%APPSHELL_BASE%%" : publicPath
|
|
24
25
|
},
|
|
25
26
|
injectTo: "head-prepend"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
tag: "link",
|
|
30
|
+
injectTo: "head-prepend",
|
|
31
|
+
attrs: {
|
|
32
|
+
rel: "preload",
|
|
33
|
+
as: "image",
|
|
34
|
+
href: "./icons/icons.svg"
|
|
35
|
+
}
|
|
26
36
|
}
|
|
27
37
|
]
|
|
28
38
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vite-generate-base-plugin.js","sourceRoot":"","sources":["../src/vite-generate-base-plugin.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD
|
|
1
|
+
{"version":3,"file":"vite-generate-base-plugin.js","sourceRoot":"","sources":["../src/vite-generate-base-plugin.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CACrC,cAAgC,EAChC,kBAA2B;IAE3B,MAAM,UAAU,GAAG,aAAa,CAAC,cAAc,CAAC,CAAC;IAEjD,OAAO;QACL,IAAI,EAAE,2BAA2B;QACjC,OAAO,EAAE,KAAK;QACd,kBAAkB,EAAE;YAClB,OAAO,EAAE,MAAM;YACf,SAAS,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,CAAC;gBAC5B,IAAI,EACF,kBAAkB,IAAI,cAAc,CAAC,IAAI,IAAI,IAAI;oBAC/C,CAAC,CAAC,IAAI,CAAC,OAAO,CACV,uBAAuB,EACvB,UACE,kBAAkB;wBAChB,CAAC,CAAC,oBAAoB;wBACtB,CAAC,CAAC,cAAc,CAAC,IACrB,UAAU,CACX;oBACH,CAAC,CAAC,IAAI;gBACV,IAAI,EAAE;oBACJ;wBACE,GAAG,EAAE,MAAM;wBACX,KAAK,EAAE;4BACL,IAAI,EAAE,kBAAkB,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,UAAU;yBAC5D;wBACD,QAAQ,EAAE,cAAc;qBACzB;oBACD;wBACE,GAAG,EAAE,MAAM;wBACX,QAAQ,EAAE,cAAc;wBACxB,KAAK,EAAE;4BACL,GAAG,EAAE,SAAS;4BACd,EAAE,EAAE,OAAO;4BACX,IAAI,EAAE,mBAAmB;yBAC1B;qBACF;iBACF;aACF,CAAC;SACH;KACF,CAAC;AACJ,CAAC","sourcesContent":["import type { PluginOption } from \"vite\";\n\nimport type { HvAppShellConfig } from \"@hitachivantara/app-shell-shared\";\n\nimport { getPublicPath } from \"./config-utils.js\";\n\n/**\n * Add the <BASE> tag at index.html file. Tag value is obtained by the main app ({@link #getMainApp}) baseUrl ({@link #getPublicPath})‘\n * @param appShellConfig The app shell configuration.\n * @param generateEmptyShell Flag that controls if an empty app shell application is created with tags instead of final values\n */\nexport default function generateBaseTag(\n appShellConfig: HvAppShellConfig,\n generateEmptyShell: boolean\n): PluginOption {\n const publicPath = getPublicPath(appShellConfig);\n\n return {\n name: \"vite-plugin-generate-base\",\n enforce: \"pre\",\n transformIndexHtml: {\n enforce: \"post\",\n transform: (html: string) => ({\n html:\n generateEmptyShell || appShellConfig.name != null\n ? html.replace(\n /<title>(.*?)<\\/title>/,\n `<title>${\n generateEmptyShell\n ? \"%%APPSHELL_TITLE%%\"\n : appShellConfig.name\n }</title>`\n )\n : html,\n tags: [\n {\n tag: \"base\",\n attrs: {\n href: generateEmptyShell ? \"%%APPSHELL_BASE%%\" : publicPath\n },\n injectTo: \"head-prepend\"\n },\n {\n tag: \"link\",\n injectTo: \"head-prepend\",\n attrs: {\n rel: \"preload\",\n as: \"image\",\n href: \"./icons/icons.svg\"\n }\n }\n ]\n })\n }\n };\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hitachivantara/app-shell-vite-plugin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.0",
|
|
4
4
|
"description": "AppShell Vite Plugin",
|
|
5
5
|
"author": "Hitachi Vantara - Boba Fett Team",
|
|
6
6
|
"type": "module",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@emotion/cache": "^11.11.0",
|
|
36
36
|
"@emotion/react": "^11.11.1",
|
|
37
|
-
"@hitachivantara/app-shell-shared": "0.10.
|
|
37
|
+
"@hitachivantara/app-shell-shared": "0.10.2",
|
|
38
38
|
"@hitachivantara/uikit-react-icons": "^5.6.0",
|
|
39
39
|
"@hitachivantara/uikit-react-shared": "^5.1.0",
|
|
40
40
|
"@rollup/plugin-commonjs": "^24.0.0",
|
|
@@ -57,5 +57,5 @@
|
|
|
57
57
|
"@types/react-dom": "^18.0.11",
|
|
58
58
|
"tsc-watch": "^6.0.0"
|
|
59
59
|
},
|
|
60
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "f61368015d8b44ea81225231fb5d05d141a990e1"
|
|
61
61
|
}
|