Skip to content

Commit 63ff9e9

Browse files
authored
V16: Build Backoffice externals with Vite (#19716)
* chore: revamps openid package to organise files in a 'src' folder * feat: adds all externals as npm workspaces with a vite build * feat: copies the correct uui assets * feat: copies the backoffice static assets * feat: creates the correct module for openid * feat: copies the correct monaco-editor assets * feat: moves monaco-editor into its package * feat: moves dependencies to relevant external modules * feat: gets rid of rollup * build: uses tiny-glob instead of glob (one less dependency) * feat: copies all css assets to dist-cms/css first, minifies them, then copies everything over to StaticAssets * build: removes old static assets from vite static build
1 parent d95b6b7 commit 63ff9e9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+1374
-696
lines changed

src/Umbraco.Web.UI.Client/devops/build/copy-to-cms.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,24 @@
11
import { cpSync, rmSync } from 'fs';
2+
import { execSync } from 'child_process';
23

34
const srcDir = './dist-cms';
45
const outputDir = '../Umbraco.Cms.StaticAssets/wwwroot/umbraco/backoffice';
56

7+
// Copy assets
8+
console.log('--- Copying assets ---');
9+
cpSync('./src/assets', `${srcDir}/assets`, { recursive: true });
10+
console.log('--- Copying assets done ---');
11+
12+
// Copy SRC CSS
13+
console.log('--- Copying src CSS ---');
14+
cpSync('./src/css', `${srcDir}/css`, { recursive: true });
15+
console.log('--- Copying src CSS done ---');
16+
17+
// Minify CSS
18+
console.log('--- Minifying CSS ---');
19+
execSync('npx postcss dist-cms/css/**/*.css --replace --use cssnano --verbose', { stdio: 'inherit' });
20+
console.log('--- Minifying CSS done ---');
21+
622
rmSync(outputDir, { recursive: true, force: true });
723
cpSync(srcDir, outputDir, { recursive: true });
824

src/Umbraco.Web.UI.Client/devops/package/validate-exports.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { globSync } from 'glob';
1+
import glob from 'tiny-glob';
22
import { packageJsonExports } from './meta.js';
33

44
const validateExports = async () => {
@@ -7,7 +7,7 @@ const validateExports = async () => {
77
// Iterate over the exports in package.json
88
for (const [key, value] of Object.entries(packageJsonExports || {})) {
99
if (value) {
10-
const jsFiles = await globSync(value);
10+
const jsFiles = await glob(value, { filesOnly: true });
1111

1212
// Log an error if the export from the package.json does not exist in the build output
1313
if (jsFiles.length === 0) {

0 commit comments

Comments
 (0)