dominictarr / rc

The non-configurable configuration loader for lazy people.
Other
1.02k stars 97 forks source link

#! breaking webpack loaders #95

Closed Nevraeka closed 7 years ago

Nevraeka commented 7 years ago

I'm using cross-env with webpack and running into this issue when encountering '#!' in rc...

ERROR in ./~/fsevents/~/rc/index.js
Module parse failed: /MyProfile/my-repo/node_modules/fsevents/node_modules/rc/index.js Un
expected character '#' (1:0)
You may need an appropriate loader to handle this file type.
| #! /usr/bin/env node
| var cc   = require('./lib/utils')
| var join = require('path').join

The reference to your repo is a nested dependency inside fsevents. I can do a PR if needed but I am uncertain how this particular module would work without that. Any thoughts or suggestions?

I am using Node v0.6.8 on Mac OSX and Webpack v2.3.2

Thanks in advance. Also -here is another Github Reference semi-related to this (Meteor)

dominictarr commented 7 years ago

this is a bug in webpack. see this issue https://github.com/webpack/webpack/issues/2168

dominictarr commented 7 years ago

that #! has been part of node since forever, if webpack can't handle that, it isn't compatible with node

Nevraeka commented 7 years ago

That is what I would assume. Yeah...that is surprising that Webpack would not be able to handle that. Especially with target: node as a possible configuration. Sorry for the confusion and thank you for looking into this. I appreciate your time @dominictarr :)

dominictarr commented 7 years ago

@Nevraeka I think this is a recent webpack thing, because I did not change #! but have suddenly got complaints about webpack. (personally, I use browserify, which handles this fine)

Nevraeka commented 7 years ago

Very strange indeed. On a side note - I like browserify as well. I always enjoyed working w/ StealJS too but alas...I never got the green light to use it at any place I worked. Both are great for small & medium sized projects. Webpack has a lot of great features and scales nicely IMO but the tradeoff is complexity & configuration. My workplace is on the React hype-train ATM so Webpack seems to be the favored tool for now in the React community. I think I bit off more than I can chew though by implementing TypeScript & SSR with Webpack all at once. It sounded good at the time but debugging is sucking ATM :|