yeoman / generator-chrome-extension

Scaffold out a Chrome extension
http://yeoman.io
MIT License
2.62k stars 224 forks source link

Replace Bower with import #200

Open hkdobrev opened 6 years ago

hkdobrev commented 6 years ago

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?

ragingwind commented 6 years ago

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.

hkdobrev commented 6 years ago

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.

ragingwind commented 6 years ago

Right but this generator completely dedicated to Chrome.

mischah commented 6 years ago

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:

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

sangimed commented 6 years ago

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

hkdobrev commented 6 years ago

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

ranbuch commented 6 years ago

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

hkdobrev commented 6 years ago

@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.

ranbuch commented 6 years ago

Send a pull request with what?

MarkOSullivan94 commented 5 years ago

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