Skip to content

Conversation

Trinovantes
Copy link
Contributor

I'll write some tests later when I have more time

@joshgoebel
Copy link
Member

Out of curiosity how would we inject into a component? Just have a function that takes Highlight.js instance as an argument and returns a component using that instance?

"allowSyntheticDefaultImports": true,

"outDir": "dist",

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious: What makes this no longer necessary with v11?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think v11 fixed the file paths. I couldn't get this to compile once I upgraded to v11 without removing this alias

@Trinovantes
Copy link
Contributor Author

Out of curiosity how would we inject into a component? Just have a function that takes Highlight.js instance as an argument and returns a component using that instance?

You can pass options when you use the plugin:

app.use(hljsVuePlugin, {
  hljs
})

Then access it in the plugin install function

    install(app, { hljs }) {
        app.component('highlightjs', component) // instead of component object itself, insert a factory function that uses the hljs instance
    },

@joshgoebel joshgoebel merged commit e3d5d84 into highlightjs:main Jun 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants