apache / cordova-discuss

Discussions on features and the future
19 stars 28 forks source link

Better integrate with module bundlers #73

Open remcohaszing opened 7 years ago

remcohaszing commented 7 years ago

I'd love to see better integration with module bundlers, such as webpack.

I think I figured out the global steps of what needs to be done for this.

I might be missing a lot of details, because I'm not that familiar with Cordova internals.

dpogue commented 7 years ago

As someone who uses Cordova to build web apps, I'm pretty opposed to anything that requires my app code to know that Cordova exists. I'm building apps for the web, Cordova is just a packaging tool and polyfill loader (in the form of plugins). My app should not know or care that it's running in Cordova.

Currently Cordova requires the app to include <script src="cordova.js"></script> in the index page, which is slightly annoying but easy enough to workaround with a empty cordova.js file for web.

Plugins can already require node modules using npm via their package.json files if Cordova is run with the --browserify option (which I believe is default now?)

stevengill commented 7 years ago

@dpogue browserify is not default.