adambullmer / vue-cli-plugin-browser-extension

Browser extension development plugin for vue-cli 3.0
GNU Lesser General Public License v3.0
426 stars 76 forks source link

[FIX] content-script / background #64

Closed rrfaria closed 4 years ago

rrfaria commented 4 years ago
SubZtep commented 4 years ago

Thanks for this PR, solved my issue. :pray:

Until the new release here is a quick fix in vue.config.js:

module.exports = {
  // ...
  configureWebpack: config => {
    if (process.env.NODE_ENV === "development") {
      config.optimization.splitChunks.cacheGroups.vendors.chunks = () => false
      config.optimization.splitChunks.cacheGroups.common.chunks = () => false
    }
  }
}
franciscolourenco commented 4 years ago

Can you describe the problem this is supposed to fix? thanks.

eamonnmg commented 4 years ago

This fixed my issue too. Before background.js would not run for some reason.

Not sure why it works (or didn't work in first place) though 😅

rrfaria commented 4 years ago

My PR didn't work properly has some issues to be fixed , but the code need to be better analysed

adambullmer commented 4 years ago

Figured out the root cause as to why this was necessary. Looks like later versions of vue-cli-service would add the optimizations into development builds. A release has been pushed on 0.23.1 to resolve this.