Skip to content
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

es6 builder #6

Open
heavyk opened this issue Mar 9, 2016 · 0 comments
Open

es6 builder #6

heavyk opened this issue Mar 9, 2016 · 0 comments

Comments

@heavyk
Copy link

heavyk commented Mar 9, 2016

previously, the builder would assemble all required modules into an imports object, however now it does not.

it would require one to "derequire" the source for it to work (and a new require function was defined). disregarding the other problems that custom require function made, the new version does not do anything at all with the imports. it doesn't even make adependencyBlock any more.

this works ok for all require statements which are npm modules, however if one of the require statements is a local path - require('../lala/my/lib'), it will no longer work, because gobble will do its browserify requiring after rollup (and so those files files won't exist).

this has an advantage where one can provide a partitioned bundle with a little work (not all deps need to be in the same app.js).

however, for this to work properly for local paths, consider this case:

component.exports = {
  decorators: {
    lala: require('../decorators/lala')
  }
}

the require statement will need to be replaced with the appropriate __imports${counter}___ so it would look something like this:

import __imports0__ from '../decorators/lala'
component.exports = {
  decorators: {
    lala: __imports0__
  }
}

I'm working on this change now, but actually, considering this change, there will now be duplicate functionality in rcu and rcu-builders.

PR probably coming soon. code is a bit messy atm

thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant