remove prismjs and add it as a script & updaye codehighlight

pull/3437/head
Tuğçe Küçükoğlu 2022-12-20 20:29:41 +03:00
parent 7625a006d2
commit c0d820e998
5 changed files with 309 additions and 2359 deletions

View File

@ -1,7 +1,7 @@
import Prism from 'prismjs'; import { DomHandler } from 'primevue/utils';
const CodeHighlight = { const CodeHighlight = {
beforeMount(el, binding) { mounted(el, binding) {
const modifiers = binding.modifiers; const modifiers = binding.modifiers;
const value = binding.value; const value = binding.value;
@ -9,7 +9,7 @@ const CodeHighlight = {
else if (modifiers.css || value === 'css') el.className = 'language-css'; else if (modifiers.css || value === 'css') el.className = 'language-css';
else el.className = 'language-markup'; else el.className = 'language-markup';
Prism.highlightElement(el.children[0]); DomHandler.isClient() && window.Prism.highlightElement(el.children[0]);
} }
}; };

View File

@ -55,11 +55,15 @@ export default defineNuxtConfig({
gtag('config', 'UA-93461466-1'); gtag('config', 'UA-93461466-1');
` `
},
{
src: baseUrl + 'scripts/prism.js',
'data-manual': true
} }
] ]
} }
}, },
css: ['@/assets/styles/primevue.css', '/node_modules/primeflex/primeflex.css', '/node_modules/primeicons/primeicons.css', '/node_modules/prismjs/themes/prism-coy.css', '@/assets/styles/flags.css'], css: ['@/assets/styles/primevue.css', '/node_modules/primeflex/primeflex.css', '/node_modules/primeicons/primeicons.css', '@/assets/styles/flags.css'],
vite: { vite: {
plugins: [vueJsx()], plugins: [vueJsx()],
resolve: { resolve: {

2644
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -42,7 +42,6 @@
"nuxt": "^3.0.0", "nuxt": "^3.0.0",
"primeflex": "^3.3.0", "primeflex": "^3.3.0",
"primeicons": "^6.0.1", "primeicons": "^6.0.1",
"prismjs": "^1.15.0",
"quill": "^1.3.7", "quill": "^1.3.7",
"rollup-plugin-postcss": "^4.0.0", "rollup-plugin-postcss": "^4.0.0",
"rollup-plugin-terser": "^7.0.2", "rollup-plugin-terser": "^7.0.2",

11
public/scripts/prism.js Normal file

File diff suppressed because one or more lines are too long