adambullmer / vue-cli-plugin-browser-extension

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

Remove option for browser extension polyfill #50

Closed adambullmer closed 5 years ago

adambullmer commented 5 years ago

Proposal Since the community has taken some steps to make this a more browser agnostic extension tool, I want to kill the option for including the polyfill and just always include it (and use the auto-include polyfill). For the users who want to make chrome only extensions, that is still possible as the polyfill doesn't remove or disable the chrome object.

Benefit This will simplify the docs, templates, and initial options as everything can be written consistently. While it does increase the file size of the end distributable (20.5kb unminified), in the presence of the large iconigraphy, Vue as a framework, and other libraries being included this should not be the main focus point of where to trim a few kbs. If after all that, someone needs to trim it down and doesn't want the polyfill, it is now removable since it has been added to the webpack chain.

vue.config.js

module.exports = {
  chainWebpack(config) {
    config.plugins.delete('provide-webextension-polyfill');
    config.module.rules.delete('provide-webextension-polyfill');
  }
}