mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
build(editor): Include shims for sanitize-html (no-changelog) (#17375)
This commit is contained in:
@@ -125,6 +125,7 @@
|
||||
"unplugin-icons": "catalog:frontend",
|
||||
"unplugin-vue-components": "catalog:frontend",
|
||||
"vite": "catalog:",
|
||||
"vite-plugin-node-polyfills": "^0.24.0",
|
||||
"vite-plugin-static-copy": "2.2.0",
|
||||
"vite-svg-loader": "5.1.0",
|
||||
"vitest": "catalog:",
|
||||
|
||||
1
packages/frontend/editor-ui/src/source-map-js-shim.ts
Normal file
1
packages/frontend/editor-ui/src/source-map-js-shim.ts
Normal file
@@ -0,0 +1 @@
|
||||
export default {};
|
||||
@@ -1,7 +1,8 @@
|
||||
import vue from '@vitejs/plugin-vue';
|
||||
import { posix as pathPosix, resolve } from 'path';
|
||||
import { defineConfig, mergeConfig } from 'vite';
|
||||
import { defineConfig, mergeConfig, type UserConfig } from 'vite';
|
||||
import { viteStaticCopy } from 'vite-plugin-static-copy';
|
||||
import { nodePolyfills } from 'vite-plugin-node-polyfills';
|
||||
import svgLoader from 'vite-svg-loader';
|
||||
|
||||
import { vitestConfig } from '@n8n/vitest-config/frontend';
|
||||
@@ -63,9 +64,14 @@ const alias = [
|
||||
find: /^lodash\.(.+)$/,
|
||||
replacement: 'lodash/$1',
|
||||
},
|
||||
{
|
||||
// For sanitize-html
|
||||
find: 'source-map-js',
|
||||
replacement: resolve(__dirname, 'src/source-map-js-shim'),
|
||||
},
|
||||
];
|
||||
|
||||
const plugins = [
|
||||
const plugins: UserConfig['plugins'] = [
|
||||
icons({
|
||||
compiler: 'vue3',
|
||||
autoInstall: true,
|
||||
@@ -125,6 +131,10 @@ const plugins = [
|
||||
return html.replace('%CONFIG_SCRIPT%', replacement);
|
||||
},
|
||||
},
|
||||
// For sanitize-html
|
||||
nodePolyfills({
|
||||
include: ['fs', 'path', 'url', 'util', 'timers'],
|
||||
}),
|
||||
];
|
||||
|
||||
const { RELEASE: release } = process.env;
|
||||
|
||||
Reference in New Issue
Block a user