You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
FYI gulp gets this for free by using liftoff and node-interpret behind the scenes. There was a lot of handwringing about adding native coffee support to gulp but it was eventually added by its dependency tree.
Unfortunately, I couldn't figure out how to do it so I needed to compile my coffeescript file by hand which isn't good since it is unclear on which is the source.
I tried the way is works with mocha (my only reference) with '--register/something coffee-script' but that didn't work.
Can you please document the two liner or at least provide it in this thread for others to find?
If you'd use a Makefile to run webpack, it'd be very simple. I think you could also use package.json scripts, and pipe around coffee -s -c and somehow tell webpack to read the compiled .js. Unfortunately webpack doesn't support reading config.js from stdin.
For anyone interested, this is how liftoff requires config files. I'm not familiar enough with webpack's internals but if I got pointed in the right direction I could try and whip something up.
The problem is your PR requires passing a --coffee flag instead of detecting the file and its extension automatically. Your code also would have to be repeated for every compile-to-js variant (TypeScript, LiveScript, etc). Is there any reason not to use node-interpret for this?
No go right ahead and create a PR :-) No reason why mine can't be merged
and removed later - if you specify webpack.config.coffee as the
configuration file it just works either way.
The problem is your PR requires passing a --coffee flag instead of
detecting the file and its extension automatically. Your code also would
have to be repeated for every compile-to-js variant (TypeScript,
LiveScript, etc). Is there any reason not to use node-interpret for
this?
—
Reply to this email directly or view it on GitHub #475 (comment).
Activity
sokra commentedon Sep 16, 2014
No, sorry, but I don't want to add the coffeescript dependency for everyone.
It's a two liner for you to use a
webpack.config.coffee.akre54 commentedon Sep 16, 2014
FYI gulp gets this for free by using liftoff and node-interpret behind the scenes. There was a lot of handwringing about adding native coffee support to gulp but it was eventually added by its dependency tree.
kmalakoff commentedon Sep 17, 2014
@sokra that's fine as long as there is a way.
Unfortunately, I couldn't figure out how to do it so I needed to compile my coffeescript file by hand which isn't good since it is unclear on which is the source.
I tried the way is works with mocha (my only reference) with '--register/something coffee-script' but that didn't work.
Can you please document the two liner or at least provide it in this thread for others to find?
sokra commentedon Sep 17, 2014
kmalakoff commentedon Sep 17, 2014
Thank you for the work around.
I do not think this is a good solution since it pollutes the file system. I'd like something seamless and automatic like native support.
andreypopp commentedon Sep 17, 2014
You could create your own launcher for webpack which compiles config.
kmalakoff commentedon Sep 17, 2014
@andreypopp you shouldn't need to add a bash script or write your own launcher. It should appear as native.
I'll take @akre54 's advice look at some third party module way to pull it in like writing webpack-config-coffeescript. I didn't even think of that.
lookfirst commentedon Sep 21, 2014
@sokra So lame that I have to add another file. Just make it easy for those of us who like CS. Geeez. 👎
sokra commentedon Sep 21, 2014
Ok I would accept a PR adding node-interpret, if it doesn't add dependencies to the languages to webpack.
tiye commentedon Sep 29, 2014
Well it's actually liftoff.
https://www.npmjs.org/package/liftoff
https://github.com/callumlocke/trip/blob/master/cli.js#L13
pikeas commentedon Oct 11, 2014
+1 to liftoff for webpack.config.coffee support.
skrat commentedon Dec 2, 2014
If you'd use a Makefile to run webpack, it'd be very simple. I think you could also use package.json scripts, and pipe around
coffee -s -cand somehow tell webpack to read the compiled .js. Unfortunately webpack doesn't support reading config.js from stdin.iboozyvoozy commentedon Feb 5, 2015
No news for coffee support?
Support CoffeeScript configuration files
wmertens commentedon Mar 11, 2015
Since webpack is just
require-ing the config file, this needs two things:coffee-scriptmodule required before loading the config filerequire-ing the default config aswebpack.config, so that it could be a.jsor a.coffee(or even a.jsonI think)Opened PR #872
akre54 commentedon Mar 11, 2015
For anyone interested, this is how liftoff requires config files. I'm not familiar enough with webpack's internals but if I got pointed in the right direction I could try and whip something up.
Support CoffeeScript configuration files
wmertens commentedon Mar 11, 2015
I just updated my PR so that it automagically works when the config file
ends in .coffee as well.
On Wed, Mar 11, 2015 at 2:31 PM Adam Krebs [email protected] wrote:
akre54 commentedon Mar 11, 2015
The problem is your PR requires passing a
--coffeeflag instead of detecting the file and its extension automatically. Your code also would have to be repeated for every compile-to-js variant (TypeScript, LiveScript, etc). Is there any reason not to use node-interpret for this?wmertens commentedon Mar 11, 2015
No go right ahead and create a PR :-) No reason why mine can't be merged
and removed later - if you specify webpack.config.coffee as the
configuration file it just works either way.
On Wed, Mar 11, 2015 at 4:35 PM Adam Krebs [email protected] wrote:
monder commentedon Apr 6, 2015
Added PR with node-interpret
wmertens commentedon Apr 7, 2015
so now this can be closed right?
nickperkinslondon commentedon Aug 22, 2016
For anyone doing this...
I would recommend using a different name for your coffee file just so it never accidentally gets compiled and over-writes your js file.