Add a build step to copy the license and readme into the build output.
This commit is contained in:
parent
b70e4107b7
commit
d28f4af088
1 changed files with 17 additions and 2 deletions
|
|
@ -67,7 +67,6 @@ compendia packs for production
|
|||
function buildPacks() {
|
||||
return {
|
||||
async writeBundle(options) {
|
||||
// console.log(options);
|
||||
const buildDir = options.dir;
|
||||
await buildCompendia();
|
||||
await cp(`${__dirname}/packs`, `${buildDir}/packs`, { recursive: true, force: true });
|
||||
|
|
@ -78,11 +77,27 @@ function buildPacks() {
|
|||
};
|
||||
};
|
||||
|
||||
/*
|
||||
Allows copying a file from somewhere into the build directory once the build has
|
||||
completed.
|
||||
*/
|
||||
function copyFile(filepath, targetPath) {
|
||||
return {
|
||||
async writeBundle(options) {
|
||||
const buildDir = options.dir;
|
||||
await cp(filepath, `${buildDir}/${targetPath}`);
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
// MARK: config
|
||||
export default defineConfig(({ mode }) => {
|
||||
const isProd = mode === `prod`;
|
||||
|
||||
const plugins = [];
|
||||
const plugins = [
|
||||
copyFile(`LICENSE`, `LICENSE`),
|
||||
copyFile(`README.md`, `README.md`),
|
||||
];
|
||||
|
||||
if (isProd) {
|
||||
plugins.push(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue