-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Cannot be used in Node 0.12 (browserify based apps) #15
Comments
What if we declare |
damn, this browser-field might do the trick I was trying to point main directly to the dist file, but there was a lot of "require" errors in the terminal, since all the required files are already bundled in the dist file. This might be a solution 👍 |
@zenorocha, tested here with my lib, and I think that will actually work. will you work on that? |
HAHAHAHAAH Nope, can you test with Node and send a PR? |
Sure, I'll probably work on that tonight. |
Hey @zenorocha, just did a PR #19 I'll take a look in how I can improve the tests for requirejs and commonjs projects, in the meanwhile, this PR has tests for projects that uses browserify. |
@ibc it should be fixed as of https://github.com/zenorocha/clipboard.js/releases/tag/v1.3.1 Could you test and let us know? |
If I add the lib (master branch) into the package.json of my browserify based project, calling |
I moved to dependencies as requested ;) |
|
I mean: is up to me whether I'm building a browserify based project or not. If so, when browserify "compiles" clipboard.js it will honor the "browserify" data in package.json, but browserify should not be placed in |
But you can't run babelify without browserify. I'm confused. |
Example usecase:
When I run my browserify task it takes the That's all. I won't use the |
Uhm...one approach is to create a clipboard.transpiled.js into dist folder and point it in "browser" field(I can do this with a PR using babel compiler as dev dependencie). Then neither browserify nor babelify would be a main dependency, and the install would turn faster on NPM 3. Not to mention webpack and jspm could reach this file as well without any transpiler required. |
However we have src/clipboard-action.js to be transpiled as well . Maybe create a folder dist/transpiled and point it in "browser" field. 😞 |
Example: heldr@b041513 drawback: Babel's _classCallCheck is repeated twice |
Fixed in |
nice! 😎 |
Obviously
import
is not implemented in Node 0.12 as it is not ES6. However I usually build my JS web apps as a Node project + browserify. Unfortunately the usage ofimport
makes this unfeasible.The text was updated successfully, but these errors were encountered: