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() {
|
function buildPacks() {
|
||||||
return {
|
return {
|
||||||
async writeBundle(options) {
|
async writeBundle(options) {
|
||||||
// console.log(options);
|
|
||||||
const buildDir = options.dir;
|
const buildDir = options.dir;
|
||||||
await buildCompendia();
|
await buildCompendia();
|
||||||
await cp(`${__dirname}/packs`, `${buildDir}/packs`, { recursive: true, force: true });
|
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
|
// MARK: config
|
||||||
export default defineConfig(({ mode }) => {
|
export default defineConfig(({ mode }) => {
|
||||||
const isProd = mode === `prod`;
|
const isProd = mode === `prod`;
|
||||||
|
|
||||||
const plugins = [];
|
const plugins = [
|
||||||
|
copyFile(`LICENSE`, `LICENSE`),
|
||||||
|
copyFile(`README.md`, `README.md`),
|
||||||
|
];
|
||||||
|
|
||||||
if (isProd) {
|
if (isProd) {
|
||||||
plugins.push(
|
plugins.push(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue