-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dependency on highlight.js issue #88
Comments
@a-birla Can you provide error messages for the |
in the highlight.js package, I have one highlight.js file inside lib folder. If I reference that in my script, it does not apply any highlighting. There are errors when I try to use Uncaught Error: Unknown language: "bash" Also I checked the highlight.js file on https://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.3/highlight.min.js is very different from what is downloaded when I do npm install highlight.js |
@a-birla CDN version might already have languages registered. Looks like Usually you'll require const hljs = require('highlight.js');
// This actually point to require('./path/to/node_modules/highlight.js/lib/index.js')
// which is defined in `package.json` key `main` rather than |
So in the gulp task where we are concatenating all node modules js files, we give the path only for Index.js and not highlight.js?
… On Sep 27, 2017, at 11:10 PM, Chih-Hsuan Fan ***@***.***> wrote:
@a-birla CDN version might already have languages registered. Looks like npm version has the languages registered in libs/index.js.
Usually you'll require highlight.js with
const hljs = require('highlight.js');
// This actually point to require('./path/to/node_modules/highlight.js/lib/index.js')
// which is defined in `package.json` key `main`
rather than require('./path/to/node_modules/highlight.js/lib/highlight.js');
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
So you're using gulp to concatenate js files rather than bundlers like webpack, rollup etc? |
no that is not working either. If I only reference index.js, getting this error Uncaught ReferenceError: require is not defined |
It seems that the npm version still requires a build procress to work if you're not using a CommonJS compatible bundler. I'd suggest just use the CDN version or integrate the highlight.js build process into your gulp task. |
if you are using
|
as this module has dependency on highlight.js, if I install highlight.js via npm and give the path of the js file created under node_modules and install angular-highlightjs via npm/bower, it does not highlight any content.
but if I use the cdn copy of highlight.js or build it locally myself, then it highlights content very well. What is the issue here?
The text was updated successfully, but these errors were encountered: