Closed knownasilya closed 9 years ago
Seems to be working fine, although using shimmed libs for their side-effect is (e.g. where require('./bootstrap')
changes jQuery) probably not worth it, just use app.import
in that case.
@knownasilya How were you able to define the browserify-shim transform in config/environment.js?
I used this format: https://github.com/thlorenz/browserify-shim#packagejson-1
The browserify
option goes into the config/environment.js
but the browserify-shim
stays as is in the package.json
.
Where in config/environment would the browserify
option go? Is there an env variable you set? Why won't putting it in package.json
work?
See the readme of this project.
ENV.browserify = {};
You can put it at the top level most likely.
Sorry, just found it. Thanks! https://github.com/ef4/ember-browserify/blob/master/lib/index.js#L30
Ugh, still can't get this to work. package.json:
"browserify-shim": {
"jquery": "global:Ember.$"
}
config/environment.js:
browserify: { transform: ['browserify-shim'] }
Error: Cannot find module 'jquery'
Just needed a good 'ole {global: true}
. Leaving this here in the hopes it helps someone down the line. Corrected config/environment.js:
browserify: {
transform: [
['browserify-shim', {global: true}]
]
}
(like in the example shown in the README.)
Want to setup browserify-shim, do I define the transform in config/environment.js and then just setup the
browser
andbrowserify-shim
properties in the package.json?