(0 , _highlightjsVue.default) is not a function
patarapolw opened this issue · 6 comments
I think last lines should probably be changed to something like,
var hljsRegisterVue = function(hljs) {
hljs.registerLanguage("vue", hljsDefineVue);
};
module.exports = hljsRegisterVue;
module.exports.hljsRegisterVue = hljsRegisterVue;
module.exports.hljsDefineVue = hljsDefineVue;
/**
* @deprecated
*/
module.exports.definer = hljsDefineVue;Can you provide a more info, a codepen for instance?
I think this is related to Babel, but I need more info.
NVM, I move the definition inside Class scope, so there is no problem now.
Still, I believe you shouldn't module.export.definer.
The problem returns, but it is easily fixed by changing "main": "vue.js",; So I guess it is a regression report. Rollup doesn't work. (why would you need rollup for commonjs, anyway?)
The code is https://github.com/patarapolw/make-html/blob/59151beb90c583df58227ccbd0f894fab595a4f9/packages/frontend-functions/src/index.ts#L15, BTW.
Seeing this issue too
Highlight.js maintainer here. Please see highlightjs/highlight.js#3008
In core team's opinion the correct answer here is:
- separate source and CDN distributable, do not try to mix them both in the same file
- the raw source is just a module with a single default export
- this raw source is what you would publish for use via
npm, etc. - the CDN distributable should follow our standard and include the minified grammar PLUS
hljs.registerLanguage(for easy use in web browser)
And Highlight.js can even build that CDN distributable for you. It takes only a few seconds. Please have a look at the issue in question and let me know if you have any questions.