* feat: resolve TODO by removing quiet option * feat: exclude ./src/mocks from production build * feat: load only msw when running through vite * feat: optimise load order * feat: handles mocked logos with virtual path * feat: loads mocked service worker from virtual path * feat: loads assets from virtual path * feat: forces MSW=on for the static build * build: adds storybook workflow copied over from the old backoffice repository * build: limits where the build runs * build: adds workflow to build a static version of the backoffice upon request * build: excludes the `/umbraco/backoffice/assets` folder from navigation fallback just in case * build: triggers run when the workflow file itself changes * build: triggers run when package.json changes * build: marks the 'contrib' branch as production * build: activates static builds on preview/* labels * build: bumps github checkout version * build: updates key for backoffice web app * build: updates key for storybook * build: disables build for release branches to preseve on preview environments
61 lines
1.4 KiB
TypeScript
61 lines
1.4 KiB
TypeScript
import { defineConfig, PluginOption } from 'vite';
|
|
import { viteStaticCopy } from 'vite-plugin-static-copy';
|
|
import viteTSConfigPaths from 'vite-tsconfig-paths';
|
|
|
|
export const plugins: PluginOption[] = [
|
|
viteStaticCopy({
|
|
targets: [
|
|
{
|
|
src: 'public-assets/App_Plugins/*.js',
|
|
dest: 'App_Plugins',
|
|
},
|
|
{
|
|
src: 'public-assets/App_Plugins/custom-bundle-package/*.js',
|
|
dest: 'App_Plugins/custom-bundle-package',
|
|
},
|
|
{
|
|
src: 'src/css/*.css',
|
|
dest: 'umbraco/backoffice/css',
|
|
},
|
|
{
|
|
src: 'node_modules/@umbraco-ui/uui-css/dist/uui-css.css',
|
|
dest: 'umbraco/backoffice/css',
|
|
},
|
|
{
|
|
src: 'node_modules/@umbraco-ui/uui-css/assets/fonts/*',
|
|
dest: 'umbraco/backoffice/assets/fonts',
|
|
},
|
|
{
|
|
src: 'src/assets/*',
|
|
dest: 'umbraco/backoffice/assets',
|
|
},
|
|
{
|
|
src: 'src/mocks/handlers/backoffice/assets/*',
|
|
dest: 'umbraco/backoffice/assets',
|
|
},
|
|
{
|
|
src: 'node_modules/msw/lib/iife/**/*',
|
|
dest: 'umbraco/backoffice/msw',
|
|
},
|
|
{
|
|
src: 'node_modules/monaco-editor/esm/**/*',
|
|
dest: 'umbraco/backoffice/monaco-editor/vs',
|
|
},
|
|
],
|
|
}),
|
|
viteTSConfigPaths(),
|
|
];
|
|
|
|
// https://vitejs.dev/config/
|
|
export default defineConfig({
|
|
build: {
|
|
sourcemap: true,
|
|
rollupOptions: {
|
|
input: {
|
|
main: new URL('index.html', import.meta.url).pathname, // Vite should only load the main index.html file
|
|
},
|
|
},
|
|
},
|
|
plugins,
|
|
});
|