use vite static assets to handle tiny on the dev server and copy tinymce to the right folder on cms build
This commit is contained in:
@@ -113,7 +113,6 @@
|
||||
"new-extension": "plop --plopfile ./devops/plop/plop.js",
|
||||
"compile": "tsc",
|
||||
"check": "npm run lint && npm run compile && npm run build-storybook",
|
||||
"postinstall": "npm run generate:tinymce",
|
||||
"generate:tinymce": "node ./devops/tinymce/index.js",
|
||||
"prepublishOnly": "node ./devops/publish/cleanse-pkg.js"
|
||||
},
|
||||
|
||||
@@ -4,7 +4,7 @@ import * as tiny from 'tinymce';
|
||||
declare const tinymce: tiny.TinyMCE;
|
||||
|
||||
const defaultConfig: tiny.RawEditorOptions = {
|
||||
base_url: '/tinymce',
|
||||
base_url: '/umbraco/backoffice/tinymce',
|
||||
};
|
||||
|
||||
/* Initialize TinyMCE */
|
||||
|
||||
@@ -31,6 +31,11 @@ console.log('--- Copying UUI Fonts ---');
|
||||
cpSync('./node_modules/@umbraco-ui/uui-css/assets/fonts', './dist-cms/assets/fonts', { recursive: true });
|
||||
console.log('--- Copying src UUI Fonts done ---');
|
||||
|
||||
// Copy TinyMCE
|
||||
console.log('--- Copying TinyMCE ---');
|
||||
cpSync('./node_modules/tinymce', './dist-cms/tinymce', { recursive: true });
|
||||
console.log('--- Copying TinyMCE done ---');
|
||||
|
||||
const readFolders = (path) => readdirSync(path).filter((folder) => lstatSync(`${path}/${folder}`).isDirectory());
|
||||
const createModuleDescriptors = (folderName) =>
|
||||
readFolders(`./src/${folderName}`).map((moduleName) => {
|
||||
|
||||
@@ -17,6 +17,10 @@ export const plugins: PluginOption[] = [
|
||||
src: 'src/assets/*.svg',
|
||||
dest: 'umbraco/backoffice/assets',
|
||||
},
|
||||
{
|
||||
src: 'node_modules/tinymce/**/*',
|
||||
dest: 'umbraco/backoffice/tinymce'
|
||||
}
|
||||
],
|
||||
}),
|
||||
viteTSConfigPaths(),
|
||||
|
||||
Reference in New Issue
Block a user