omsmith / browserify-ngannotate

57 stars 7 forks source link

ng-annotate not working with browserify programmatic API #2

Closed franleplant closed 10 years ago

franleplant commented 10 years ago

Hi! Im trying to use ng-annotate with Browserify programmatic API and it does not work, I tried setting package.json:

...
  "browserify": {
    "transform": [
      "browserify-ngannotate"
    ]
  }

...

and tried with programmatic options:

...
    var bundler = browserify({
            transform: ["browserify-ngannotate"],
            debug: true,
            entries: dir.src + 'index.js'
        });
...

Neither work. I tried running this command in the CLI:

browserify -t browserify-ngannotate index.js -o test.js

and it does work.

Any clues what might be the problem?

Thanks!

Fran

omsmith commented 10 years ago

I was able to successfully do the below. I also updated the tests to actually use browserify. What about it is not working?

var browserify = require('browserify');

browserify({
    entries: require.resolve('./basic.js')
})
.transform('browserify-ngannotate')
.bundle()
.pipe(process.stdout);
franleplant commented 10 years ago

It works! Thanks. It looks like it is an issue with browserify docs.

omsmith commented 10 years ago

Good to hear.

Shout if you run into any other issues

franleplant commented 10 years ago

:thumbsdown: !

anthonyettinger commented 7 years ago

This still doesn't work programmatically for me.

omsmith commented 7 years ago

@anthonyettinger care to share an example?