copy assets

This commit is contained in:
Mads Rasmussen
2023-05-24 21:27:30 +02:00
parent 35ad47601a
commit e7bf4dc340
7 changed files with 8 additions and 1 deletions

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 187 KiB

After

Width:  |  Height:  |  Size: 187 KiB

View File

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

View File

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

Before

Width:  |  Height:  |  Size: 942 B

After

Width:  |  Height:  |  Size: 942 B

View File

@@ -1,12 +1,15 @@
import esbuild from 'rollup-plugin-esbuild';
import commonjs from '@rollup/plugin-commonjs';
import { nodeResolve } from '@rollup/plugin-node-resolve';
import { readdirSync, lstatSync, rmSync } from 'fs';
import { readdirSync, lstatSync, rmSync, cpSync } from 'fs';
/* TODO Temp solution. I can't find a way for rollup to overwrite the external folder that is already created
by tsc. So I'm deleting it before the build.*/
rmSync('./dist-cms/external', { recursive: true, force: true });
// Copy assets
cpSync('./src/assets', './dist-cms/assets', { recursive: true });
const readFolders = (path) => readdirSync(path).filter((folder) => lstatSync(`${path}/${folder}`).isDirectory());
const createModuleDescriptors = (folderName) =>
readFolders(`./src/${folderName}`).map((moduleName) => {

View File

@@ -13,6 +13,10 @@ export const plugins: PluginOption[] = [
src: 'public-assets/App_Plugins/*.js',
dest: 'App_Plugins',
},
{
src: 'src/assets/*',
dest: 'assets/umbraco/backoffice',
},
],
}),
viteTSConfigPaths(),