2021-12-20 23:47:31 +05:30
|
|
|
const path = require("path");
|
|
|
|
const mergeOptions = require('merge-options');
|
2022-04-13 17:12:38 +05:30
|
|
|
const themeBuilder = require("./scripts/build-plugins/rollup-plugin-build-themes");
|
|
|
|
const {commonOptions, compiledVariables} = require("./vite.common-config.js");
|
2021-12-20 23:47:31 +05:30
|
|
|
|
2022-05-06 04:27:25 +05:30
|
|
|
// These paths will be saved without their hash so they havea consisent path to
|
|
|
|
// reference
|
2022-02-26 12:42:00 +05:30
|
|
|
const pathsToExport = [
|
2022-02-26 14:38:16 +05:30
|
|
|
"main.js",
|
2022-04-20 03:49:13 +05:30
|
|
|
"download-sandbox.html",
|
|
|
|
"theme-element-light.css",
|
|
|
|
"theme-element-dark.css",
|
2022-02-26 12:42:00 +05:30
|
|
|
];
|
|
|
|
|
2021-12-20 23:47:31 +05:30
|
|
|
export default mergeOptions(commonOptions, {
|
|
|
|
root: "src/",
|
|
|
|
base: "./",
|
|
|
|
build: {
|
|
|
|
outDir: "../target/asset-build/",
|
2022-02-26 12:42:00 +05:30
|
|
|
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 23:47:31 +05:30
|
|
|
},
|
2022-04-13 17:12:38 +05:30
|
|
|
plugins: [
|
|
|
|
themeBuilder({
|
|
|
|
themeConfig: {
|
|
|
|
themes: { element: "./src/platform/web/ui/css/themes/element" },
|
|
|
|
default: "element",
|
|
|
|
},
|
|
|
|
compiledVariables,
|
|
|
|
}),
|
|
|
|
],
|
2021-12-20 23:47:31 +05:30
|
|
|
});
|