mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 11:35:04 +01:00
Don't add asset hash to manifest json on build
This commit is contained in:
parent
b7675f46c4
commit
f16a2e5d22
@ -16,25 +16,33 @@ export default defineConfig(({mode}) => {
|
|||||||
sourcemap: true,
|
sourcemap: true,
|
||||||
rollupOptions: {
|
rollupOptions: {
|
||||||
output: {
|
output: {
|
||||||
assetFileNames: (asset) => asset.name.includes("config.json") ? "assets/[name][extname]": "assets/[name].[hash][extname]",
|
assetFileNames: (asset) =>
|
||||||
|
asset.name.includes("config.json") ||
|
||||||
|
asset.name.match(/theme-.+\.json/)
|
||||||
|
? "assets/[name][extname]"
|
||||||
|
: "assets/[name].[hash][extname]",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
themeBuilder({
|
themeBuilder({
|
||||||
themeConfig: {
|
themeConfig: {
|
||||||
themes: {"element": "./src/platform/web/ui/css/themes/element"},
|
themes: {
|
||||||
|
element: "./src/platform/web/ui/css/themes/element",
|
||||||
|
},
|
||||||
default: "element",
|
default: "element",
|
||||||
},
|
},
|
||||||
compiledVariables
|
compiledVariables,
|
||||||
}),
|
}),
|
||||||
// important this comes before service worker
|
// important this comes before service worker
|
||||||
// otherwise the manifest and the icons it refers to won't be cached
|
// otherwise the manifest and the icons it refers to won't be cached
|
||||||
injectWebManifest("assets/manifest.json"),
|
injectWebManifest("assets/manifest.json"),
|
||||||
injectServiceWorker("./src/platform/web/sw.js", ["index.html"], {
|
injectServiceWorker("./src/platform/web/sw.js", ["index.html"], {
|
||||||
// placeholders to replace at end of build by chunk name
|
// placeholders to replace at end of build by chunk name
|
||||||
"index": {DEFINE_GLOBAL_HASH: definePlaceholders.DEFINE_GLOBAL_HASH},
|
index: {
|
||||||
"sw": definePlaceholders
|
DEFINE_GLOBAL_HASH: definePlaceholders.DEFINE_GLOBAL_HASH,
|
||||||
|
},
|
||||||
|
sw: definePlaceholders,
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
define: definePlaceholders,
|
define: definePlaceholders,
|
||||||
|
Loading…
Reference in New Issue
Block a user