Compare commits
2 commits
master
...
theme-choo
Author | SHA1 | Date | |
---|---|---|---|
|
3b7b5d7b60 | ||
|
c636d0f991 |
2 changed files with 12 additions and 6 deletions
|
@ -33,7 +33,7 @@ function appendVariablesToCSS(variables, cssSource) {
|
||||||
|
|
||||||
function addThemesToConfig(bundle, manifestLocations, defaultThemes) {
|
function addThemesToConfig(bundle, manifestLocations, defaultThemes) {
|
||||||
for (const [fileName, info] of Object.entries(bundle)) {
|
for (const [fileName, info] of Object.entries(bundle)) {
|
||||||
if (fileName === "assets/config.json") {
|
if (fileName === "config.json") {
|
||||||
const source = new TextDecoder().decode(info.source);
|
const source = new TextDecoder().decode(info.source);
|
||||||
const config = JSON.parse(source);
|
const config = JSON.parse(source);
|
||||||
config["themeManifests"] = manifestLocations;
|
config["themeManifests"] = manifestLocations;
|
||||||
|
|
|
@ -16,11 +16,17 @@ export default defineConfig(({mode}) => {
|
||||||
sourcemap: true,
|
sourcemap: true,
|
||||||
rollupOptions: {
|
rollupOptions: {
|
||||||
output: {
|
output: {
|
||||||
assetFileNames: (asset) =>
|
assetFileNames: (asset) => {
|
||||||
asset.name.includes("config.json") ||
|
if (asset.name.includes("config.json")) {
|
||||||
asset.name.match(/theme-.+\.json/)
|
return "[name][extname]";
|
||||||
? "assets/[name][extname]"
|
}
|
||||||
: "assets/[name].[hash][extname]",
|
else if (asset.name.match(/theme-.+\.json/)) {
|
||||||
|
return "assets/[name][extname]";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return "assets/[name].[hash][extname]";
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
Reference in a new issue