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

Multiple module name for multiple entry point #54

Open
krimeshu opened this issue Feb 21, 2017 · 5 comments
Open

Multiple module name for multiple entry point #54

krimeshu opened this issue Feb 21, 2017 · 5 comments

Comments

@krimeshu
Copy link

With multiple entry point, and use IIFE format output, but I found I can not set multiple module name for each one.

Here is my situation:

gulp.src('./src/js/*.js')
    .pipe(rollup({
        entry: ['module-entry-1.js', 'module-entry-2.js'],
        format: 'iife',
        moduleName: ['moduleEntry1', 'moduleEntry2']
    })
    .pipe(gulp.desc('./desc'));

gulp-rollup just cloned the original options, and reset entry in a map function. Count moduleName be processed in the map function together?

@krimeshu
Copy link
Author

#55

@lemmabit
Copy link
Collaborator

Oh, dear. I had a feeling I should have been taking a more general-purpose approach when I implemented options.separateCaches.

I think I'll address this with a default/override system. Something like this (though the option will likely have some other name which I haven't come up with yet, rather than options.options, which is weird):

gulp.src('./src/js/*.js')
    .pipe(rollup({
        options: [
          {
            entry: 'module-entry-1.js',
            moduleName: 'moduleEntry1'
          },
          {
            entry: 'module-entry-2.js',
            moduleName: 'moduleEntry2'
          }
        ],
        format: 'iife'
    })
    .pipe(gulp.desc('./desc'));

What do you think?

@krimeshu
Copy link
Author

It's also a good idea. With this options, we can set more options for each entry file.
But it might bring some compatibility issues, if someone use old options with a new version module.

@lemmabit
Copy link
Collaborator

Old options won't have the new property, so they'll behave just like they always have.

@krimeshu
Copy link
Author

:) That will be nice, hope to see the new solutions soon~

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

2 participants