test: fix histoire configuration

Nearly

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2023-11-14 18:59:28 +01:00
parent 2e72f6faf4
commit bfbc299f37
8 changed files with 71 additions and 44 deletions

View File

@@ -15,9 +15,12 @@ export default defineConfig(({ command }) => {
process.stdin.resume();
}
return {
plugins: [
vue(),
const isStory = Boolean(process.env.HISTOIRE);
const plugins = [vue(), visualizer()];
if (!isStory) {
plugins.push(
VitePWA({
registerType: "autoUpdate",
strategies: "injectManifest",
@@ -57,21 +60,29 @@ export default defineConfig(({ command }) => {
},
],
},
}),
visualizer(),
],
build: {
manifest: true,
outDir: path.resolve(__dirname, "priv/static"),
emptyOutDir: true,
sourcemap: true,
rollupOptions: {
// overwrite default .html entry
input: {
main: "src/main.ts",
},
})
);
}
const build = {
manifest: true,
outDir: path.resolve(__dirname, "priv/static"),
emptyOutDir: true,
sourcemap: true,
};
if (!isStory) {
// overwrite default .html entry
build.rollupOptions = {
input: {
main: "src/main.ts",
},
},
};
}
return {
plugins,
build,
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),