2021-12-20 19:17:31 +01:00
|
|
|
const path = require("path");
|
|
|
|
const mergeOptions = require('merge-options');
|
|
|
|
const commonOptions = require("./vite.common-config.js");
|
|
|
|
|
2022-02-26 08:12:00 +01:00
|
|
|
const pathsToExport = [
|
2022-02-26 10:08:16 +01:00
|
|
|
"main.js",
|
2022-02-26 08:12:00 +01:00
|
|
|
"index.css",
|
|
|
|
"download-sandbox.html"
|
|
|
|
];
|
|
|
|
|
2021-12-20 19:17:31 +01:00
|
|
|
export default mergeOptions(commonOptions, {
|
|
|
|
root: "src/",
|
|
|
|
base: "./",
|
|
|
|
build: {
|
|
|
|
outDir: "../target/asset-build/",
|
2022-02-26 08:12:00 +01:00
|
|
|
rollupOptions: {
|
|
|
|
output: {
|
|
|
|
assetFileNames: (chunkInfo) => {
|
|
|
|
// Get rid of the hash so we can consistently reference these
|
|
|
|
// files in our `package.json` `exports`
|
|
|
|
if(pathsToExport.includes(path.basename(chunkInfo.name))) {
|
|
|
|
return "assets/[name].[ext]";
|
|
|
|
}
|
|
|
|
|
|
|
|
return "assets/[name]-[hash][extname]";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-12-20 19:17:31 +01:00
|
|
|
},
|
|
|
|
});
|