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

Add "entries" plugin option #23

Open
Vittly opened this issue Apr 10, 2018 · 0 comments
Open

Add "entries" plugin option #23

Vittly opened this issue Apr 10, 2018 · 0 comments
Labels
help wanted Extra attention is needed new feature

Comments

@Vittly
Copy link
Collaborator

Vittly commented Apr 10, 2018

Plugin builds bundle for each set starting from single entry.

What if different bundles represent different pages with different redux code? Now we need to import all redux code because of single entry. We have no way to write conditional imports like "import A if building 1st bundle" and "import B if building 2nd bundle".

Simplest way to fix it is to declare different entries for different sets.

Which form is better:

// #1 - plugin option
new WebpackBemPlugin({
  entries: { // or entry, or setEntries, or sets, or i-dont-know
    // kayes are names of sets
    desktop: 'desktop.js',
    touch: 'touch.js'
  }
})

// #2 - webpack option somehow handled by plugin
{
  entry: {
    // kayes are names of sets
    desktop: 'desktop.js',
    touch: 'touch.js'
  }
}

// #3 - webpack option with "variable" like in output option
{
  // bad part is entry does not have variables in standard webpack
  //   we will need to do some hacking here
  entry: '[setName].js'
}

// #4 - define entry point at bemrc
// don't know how
@Vittly Vittly added help wanted Extra attention is needed new feature labels Apr 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed new feature
Projects
None yet
Development

No branches or pull requests

1 participant