mAAdhaTTah / babel-plugin-prismjs

A babel plugin to use PrismJS with standard bundlers.
157 stars 9 forks source link

Doesn't work in Quasar Cli #189

Closed zhen-one closed 3 years ago

zhen-one commented 3 years ago

I try to use prismjs to hightlight my code block in my Quasar framework app; But it doesn't load prismjs's css and prismjs's plugins;

Here is my babel.config

/ eslint-env node / module.exports = { presets: ['@quasar/babel-preset-app'], plugins: [ [ 'prismjs', { languages: [ 'html', 'css', 'javascript', 'php', 'dart', 'bash', 'nginx', 'sql', 'c', 'cpp', 'python', 'go', 'java' ], plugins: [ 'line-numbers', 'show-language', 'copy-to-clipboard', 'inline-color' ], theme: 'okaidia', css: false } ] ] };

mAAdhaTTah commented 3 years ago

Can you share a reproducible example? I will point out that you have css: false so it wouldn't load any CSS.

zhen-one commented 3 years ago

Can you share a reproducible example? I will point out that you have css: false so it wouldn't load any CSS.

https://github.com/q350241636/prismjs-plugin-quasar

I've already uploaded a minimized version in ssr mode with typescript.

The Plugin doesn't work whether CSS property is true or false

mAAdhaTTah commented 3 years ago

The babel configuration isn't being used by the build tool. You can tell because if you open up the console and check the Prism global, it has the default languages, not the ones you requested in the config. You'll need to figure out why Quasar isn't using your babel config, but it's not an issue with this plugin.