cordova-discuss icon indicating copy to clipboard operation
cordova-discuss copied to clipboard

Better integrate with module bundlers

Open remcohaszing opened this issue 8 years ago • 2 comments

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.

remcohaszing avatar Aug 07 '17 20:08 remcohaszing

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?)

dpogue avatar Aug 07 '17 21:08 dpogue

@dpogue browserify is not default.

stevengill avatar Aug 07 '17 23:08 stevengill