amdclean
amdclean copied to clipboard
google-code-prettify isn't being added to the global variables
I've installed via bower: "google-code-prettify": "~1.0.3",
When I run things through amdclean, this is the only module that isn't being found.
I can see that the require('google-code-prettify') gets converted to just a variable of 'google_code_prettify;', but this variable isn't referenced at the top of the file like the other requires are.
Here is how I'm using amdclean (and the hacky workaround for now):
requirejs.optimize({
name: 'main'
baseUrl: "#{JS_DIR}"
mainConfigFile: "#{JS_DIR}/main.js"
out: "#{DEPLOY_APP_DIR}/main.js"
optimize: 'none'
onModuleBundleComplete: ((data) ->
cleaned = amdclean.clean({
transformAMDChecks: true
filePath: "#{DEPLOY_APP_DIR}/main.js"
wrap: {
start: '(function() { var google_code_prettify; '
end: '}());'
}
})
fs.writeFile("#{DEPLOY_APP_DIR}/main.js", cleaned, cb)
)
})
Could you send the entire module code/codebase that you are using with the require('google-code-prettify') so that I can debug more?
Sorry for the long delay. I setup a small project to show you how this bug happens.
https://gist.github.com/lookfirst/64def911d1a9083a2643
It is uploaded to the gist as a .zip file (sorry, github doesn't allow attaching files to issues).
- unzip it
- npm install
- ./node_modules/.bin/gulp heroku
- ctrl-c
Look at target/app/main.js. You'll notice that google_code_prettify isn't added to the list of variables on line 6.
I'll make sure to figure this out soon.