googlearchive / firebase-util

An experimental toolset for Firebase
http://firebase.github.io/firebase-util
MIT License
276 stars 67 forks source link

Replace built files with source in package.json #59

Open jonlong opened 9 years ago

jonlong commented 9 years ago

I ran into the same issue described in https://github.com/firebase/firebase-util/issues/57, which seems to stem from NPM using the built files in dist rather than the raw files in src.

I'm using Webpack to compile my CommonJS assets, and it throws the following error when including the built file in dist:

This seems to be a pre-built javascript file. Though this is possible, it's not recommended. Try to require the original source to get better results.

A minor update in package.json seems to point it in the right direction.

katowulf commented 9 years ago

Not sure referencing the source files here is the correct answer. Have you tried the non-minified version of the dist/ file?

ginovva320 commented 9 years ago

I've tried requiring the non-minified dist file and it does not solve the problem. However, if you run browserify with the standalone option, then it does bundle a valid CommonJS module that you can import. Not sure if this would break the browser version though.

katowulf commented 9 years ago

Great feedback, thanks. Before merging, let me do a bit of testing and see if there are any unforeseen consequences of this change.

pandaiolo commented 8 years ago

Hi, is the current version on NPM usable as a browserified module ?

I can't require() it in my browserified app (like in #57, everything is undefined). The thing is, I can't require from node_modues/src either, as the module does not bundle source? Not sure what i'm doing wrong :-)

ginovva320 commented 8 years ago

@pandaiolo It's not fixed here. You can fork my fork for the time being and install directly from github (npm install pandaiolo/firebase-util). I've been using that with browserify with no issues. All I've done in my fork is apply @jonlong's fix and merge with upstream.

pandaiolo commented 8 years ago

Perfect, can do my import { Scroll as FBscroll } from 'firebase-util'; now :+1:

Thanks @ginovva320