-
Notifications
You must be signed in to change notification settings - Fork 16
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
Doesn't play nice with pre-rollupify transforms (e.g. jsxify, coffeeify) #1
Comments
Would this go along with trying to use something like |
I'm already whitelisting certain file extensions, but yeah, this could be extended to other file types. I'd be curious to know what |
Ah my bad, missed that. My question is more about imports nested within others, which is more of a rollup issue. I can get around it passing a glob of html paths within the entry directory to rollup.external, then calling glob(path.resolve(path.dirname(filename) + "/**/*.html"), function(err, paths) { // added
writeFile(tmpfile, source, 'utf8').then(function () {
return rollup.rollup({
entry: tmpfile,
sourceMap: doSourceMap ? 'inline' : false,
external: paths // added
})
... Seems a little heavy handed, and only handles one filetype, but maybe there's a better way to handle it? Didn't see a better way to ignore file extensions in the rollup docs. |
Sorry, I don't quite understand your question. I mean this module has a whitelist of extensions, so it ought to ignore BTW circling back around to this issue, I can confirm that JSX files imported by other JSX files do not work; i.e. this module does not play nice with
Another workaround is to just use Rollup separately. E.g. build with Babel but without |
^ there's a failing test if anyone is interested in taking this up |
I tried Browserifying without So I guess what you meant is to forego Browserify entirely, and let Rollup handle it? My question is if I go this route, will Rollup do the same job as |
@nolanlawson Actually your jsx issue is the exact same as what I'm trying to describe. I was thinking non-js modules could be skipped and passed on to babelify to be transformed, but rollup does't output the directory structure so that doesn't work without detecting transforms for each non-js module, which as you said is nontrivial. tl;dr same as the |
@jessehattabaugh yeah assuming your code is valid ES6, you can run it through Rollup on the command line and then run that output through browserify. Probably less error-prone than @ansballard yeah it's a tricky issue. not sure how to proceed TBH |
#3 would actually resolve this one as well, at least for transforms that rollup has plugins for. So |
E.g. JSX files that refer each other via
import
. Not sure if it's best to call that a "wontfix" or if there's some way to crawl the dependency graph and apply other Browserify transforms before this one.The text was updated successfully, but these errors were encountered: