-
-
Notifications
You must be signed in to change notification settings - Fork 336
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
Add script to output babel with source maps #155
Comments
Well, Is directly using the ES6 source an option in your case? |
Sort of. I'm using prosemirror as a dependency. Browserify won't transform modules in If we define the browserify options in the prosemirror package.json like this {
"browserify": {
"transform": [["babelify", { "presets": ["es2015"] }]]
}
} then I can compile my script with source maps all the way to ProseMirror module sources like so node_modules/.bin/browserify src/index.js --debug --outfile dist/index.js -t [ babelify --presets [ es2015 ] --sourceMaps ] |
That would, if I understand it correctly, force everyone to run ProseMirror through babelify, even if they are importing from the For debugging, I've started using my moduleserve shim. It may not be trivial to get to work in your setup, but you might want to look at it -- it really removes a lot of the waiting and wasted work from the edit-debug cycle. Or alternatively, just run the |
Perhaps this speaks to my naïveté of writing an npm package with a dependency. Maybe some higher level questions will be better for discussion. Should sub-package authors not expect to have sourcemaps of ProseMirror package modules? This is my main question, as when working on a sub-package it would be helpful to step through PM source rather than babel-ified JS. Should ProseMirror sub-packages (e.g. a package that provides a Youtube embed node type) only include ProseMirror packages via |
My impression is that there aren't yet, and people are doing various things, all of which have drawbacks. I'm looking at the cross-compile-during-development step as something that will go away relatively soon, as browsers ramp up their ES6 support. It may be that bundling remains necessary, since even with HTTP2, I couldn't get pushing a huge amount of small packages to a browser working all that fast. And of course, for production you'll want to target ES5 browsers for a while. But hopefully, in a few months, there'll be some story for running ES6 modules in the browser (see whatwg/html#443). I may be too optimistic here. |
This makes debugging easier to read when including ProseMirror as a submodule.
I added this in
package.json
but I'm not sure that makes sense as a script.
The text was updated successfully, but these errors were encountered: