atom / highlights

Syntax highlighter
https://atom.github.io/highlights
MIT License
530 stars 54 forks source link

Impossibility to use this lib without coffeescript? #43

Closed davesnx closed 7 years ago

davesnx commented 7 years ago

Hello guys,

I'm working on some project that isn't CoffeeScript and I have some troubles for bundle my App with this dependency. It's related with highlights and node-oniguruma

Both are calling some binary (coffee-script in the hightlights case) in some point of the code.

When I'm trying to bundle the app I get the followings WARNINGS/ERRORS:

WARNING in ./~/highlights/~/coffee-script/lib/coffee-script/coffee-script.js
require.extensions is not supported by webpack. Use a loader instead.

WARNING in ./~/highlights/~/coffee-script/lib/coffee-script/register.js
require.extensions is not supported by webpack. Use a loader instead.
ERROR in ./~/highlights/~/oniguruma/build/Release/onig_scanner.node
Module build failed: SyntaxError: Unexpected token �
    at Object.parse (native)
    at Object.module.exports (/path/to/myproject/node_modules/json-loader/index.js:7:48)
 @ ./~/highlights/~/oniguruma/lib/oniguruma.js 4:16-61

ERROR in ./~/highlights/~/coffee-script/lib/coffee-script/grammar.js
Module not found: Error: Cannot resolve module 'jison' in /path/to/myproject/node_modules/highlights/node_modules/coffee-script/lib/coffee-script
 @ ./~/highlights/~/coffee-script/lib/coffee-script/grammar.js 5:11-27

ERROR in ./~/highlights/~/coffee-script/bin/coffee
Module parse failed: /path/to/myproject/node_modules/highlights/node_modules/coffee-script/bin/coffee
Unexpected character '#' (1:0)
You may need an appropriate loader to handle this file type.
SyntaxError: Unexpected character '#' (1:0)
    at Parser.pp.raise (/path/to/myproject/node_modules/acorn/dist/acorn.js:923:13)

I'm using webpack, sooo I suposed that could be that: I could add the coffee-loader in my webpack config to be able to require some coffee files, but isn't the problem I guess and I don't want to add coffee stuff on a vanilla js project.

My real question is: If you are building the source code with grunt with the coffee-script config, how the import's to the binary files works? There's something that I can do for fixing it? Anyone knows? 😢

Thanks for reading.

bcoe commented 7 years ago

Hey @davesnx, I'm curious how you're approaching installing this module; coffee-script should only be a development dependency, we compile the coffeescript into .js files prior to publishing.

davesnx commented 7 years ago

I just install it by npm @bcoe.

davesnx commented 7 years ago

Any update on this @bcoe ?