gingerhendrix / broccoli-browserify

Browserify plugin for Broccoli
9 stars 23 forks source link

Doesn't seem to do standalone properly #13

Closed jakecraige closed 6 years ago

jakecraige commented 10 years ago

I can't get a standalone output to work properly. Using the cli i get the proper output, but not with this.

var myTree = browserify('lib', {
           entries: ['./retriable-promise.js'],
           browserify: {
             standalone: 'retriablePromise'
           }
         });

does not output the same as running

browserify lib/retriable-promise.js --standalone retriablePromise

anyone have any insight as to why that is?

luketheobscure commented 9 years ago

I've been banging my head against the wall trying to figure this out!

luketheobscure commented 9 years ago

Poked around at the source, and it looks like the options passed to the constructor don't carry down to the bundle method for some reason. This is a browserify issue, not a broccoli-browserify issue. If you have a single entry point, you can just pass the options to the bundle method:

tree = browserify('app/', {
  entries: ['./main.js'],
  outputFile: './bundle.js',
  bundle: { standalone: 'globalName' },
});