angular-bacon icon indicating copy to clipboard operation
angular-bacon copied to clipboard

Use umd wrapper

Open mr-mig opened this issue 10 years ago • 5 comments

Can you please use umd wrapper and publish the module to npm?

mr-mig avatar Dec 13 '14 23:12 mr-mig

Published. UMD wrapper is a bit problematic though - even though Angular team started to publish their releases to npm, they don't export Angular as a CommonJS module yet. Angular will therefore always require some amount of shimming depending on which bundler you're using.

If you have a straightforward solution to this, I'd love to see it! Otherwise I'm going to close this issue for now, and revisit it once Angular supports CommonJS better.

lauripiispanen avatar Dec 14 '14 19:12 lauripiispanen

Angular will therefore always require some amount of shimming depending on which bundler you're using.

Yes, that's a common problem. There is angular-cjs shim for cjs modules, and shimming is pretty straightforward with AMD.

Otherwise I'm going to close this issue for now, and revisit it once Angular supports CommonJS better.

I am skeptical about this, as they have some issues with merging AMD-related pull requests for a long time.

Anyway, I am using both CJS/AMD modules and UMD will be much helpful.

mr-mig avatar Dec 14 '14 19:12 mr-mig

I need this thing as I am planning to use angular-bacon with my "framework" based on angular (from now on). I will either use requirejs or webpack (which supports AMD/cjs/es6 modules) as a opinionated module loader for those stuff.

mr-mig avatar Dec 14 '14 19:12 mr-mig

Sure, I think I'm going to do a proof of concept sometime next week to explore some options on how that might work with Browserify, RequireJS and Webpack.

lauripiispanen avatar Dec 14 '14 19:12 lauripiispanen

If you need the setup for angular, you can see it here:

  1. w webpack: https://github.com/packetloop/angular-webpack
  2. w requirejs: https://github.com/tnajdek/angular-requirejs-seed/blob/master/app/js/main.js

mr-mig avatar Dec 14 '14 20:12 mr-mig