Skip to content

Browserify compatibility #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
paulpflug opened this issue Mar 12, 2015 · 6 comments
Open

Browserify compatibility #2

paulpflug opened this issue Mar 12, 2015 · 6 comments
Assignees

Comments

@paulpflug
Copy link

treemendous = require("angular-treemendous")
angular.module("app", [treemendous])

would be wonderful ;)

just add a index.js
with

require('./angular-treemendous');
module.exports = 'treemendous';

and set the main in package.json to index.js

I can make a pr if you want

@wtfribley
Copy link
Owner

This component is already compatible with browserify:

require('angular-treemendous');
angular.module('app', ['treemendous']);

There's no need to expose the name of the component as a string.

What I can fix is the 'main' property of bower.json - I must have never updated it when I changed the name of the component. That should solve this issue.

@wtfribley
Copy link
Owner

@paulpflug can you verify that the latest version (0.2.4) works for you as recommended above? If so, I'll close this issue.

@paulpflug
Copy link
Author

yeah works, the difference between the two is, the first one will be minified. I think it is the recommended version from browserify. but maybe thats not too important ;)

@wtfribley
Copy link
Owner

I'm not sure how this difference would affect minification, but I have been taking a look around at other angular packages and it seems like this method is in wide use... it just feels weird to me to export a string, rather than the module itself. Something like:

module.exports = angular.module('treemendous', ['ngAnimate'])
var myApp = angular.module('myApp', [
  require('angular-treemendous').name
]);

But I'm still debating this... gonna do some research and then implement something better than what I have now. I also need to update dependencies and such - this project requires some general upkeep.

@paulpflug
Copy link
Author

I read about it at angular/angular.js#10732

For me it is very convincing ;)

@wtfribley
Copy link
Owner

Oh, awesome - this is exactly the discussion I was looking for!

Will update accordingly.

@wtfribley wtfribley self-assigned this Mar 18, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants