Skip to content

How to access static js file from node_modules ? #5139

Discussion options

You must be logged in to vote

For example:

hexo.extend.generator.register('yaml-js', () => {
    return {
        path: '/js/yaml.js',
        data: fs.readFileSync('node_modules/highlight.js/lib/languages/yaml.js')
    }
});

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@dimaslanjaka
Comment options

@stevenjoezhang
Comment options

Answer selected by dimaslanjaka
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants