generator-chrome-extension icon indicating copy to clipboard operation
generator-chrome-extension copied to clipboard

Replace Bower with import

Open hkdobrev opened this issue 8 years ago • 10 comments

Bower is already suggesting not to use it on the command line.

I think a good and popular suggestion is to use Gulp with Browserify.

I'd like to use https://github.com/mozilla/webextension-polyfill in my extensions and I think the best way to install it so far would be using Browserify.

What do you think?

hkdobrev avatar Oct 12 '17 10:10 hkdobrev

Nice polyfill. I prefer to using the platform as much as we can use. I consider that remove gulp and using import supported by chrome recently.

ragingwind avatar Oct 12 '17 12:10 ragingwind

With a few more changes we might end up with a generator which is quite generic and creates a WebExtensions compatible extension working in Chrome, Firefox, Edge, Opera etc.

hkdobrev avatar Oct 12 '17 14:10 hkdobrev

Right but this generator completely dedicated to Chrome.

ragingwind avatar Oct 12 '17 16:10 ragingwind

Back to the topic: Yes, migrating from Bower to npm should be done. The sooner the better.

I’ve done the groundwork by migrating generator-jasmine and generator-mocha from Bower to npm:

  • https://github.com/yeoman/generator-jasmine/releases
  • https://github.com/yeoman/generator-mocha/releases

So there is only some work left within this generator after updating the dependencies.

mischah avatar Oct 27 '17 11:10 mischah

Even MPJ suggest to not use bower https://www.quora.com/Why-use-Bower-when-there-is-npm/answer/Mattias-Petter-Johansson

sangimed avatar Apr 11 '18 10:04 sangimed

Renamed the PR to reflect we could use imports rather than Browserify.

hkdobrev avatar May 03 '18 15:05 hkdobrev

Until you'll support import how can I use an npm package on my scripts.babel/background.js file?

ranbuch avatar May 24 '18 06:05 ranbuch

@ranbuch I've set it up with Browserify initially, but the setup is not straightforward. We've just migrated our extension bootstrapped with this generator to Webpack 4 replacing Bower, Browserify and Gulp. Would try to send a pull request.

hkdobrev avatar May 24 '18 13:05 hkdobrev

Send a pull request with what?

ranbuch avatar May 25 '18 05:05 ranbuch

@hkdobrev could you show how you've done that migration?

MarkOSullivan94 avatar Jun 05 '19 20:06 MarkOSullivan94