Closed tconroy closed 8 years ago
Hi, I'm new to bower and yeoman so not maybe my conf will not work.
Here is a project where I'm using requireJS with r.js compilation (aka concatenation + uglification). https://github.com/Inateno/Dreamengine/blob/master/Gruntfile.js
Hope this help
See #372
Unfortunately this issue persists even after #372 landed on master :disappointed:
Steps to reproduce:
yo backbone:all Foo
main.js
and instantiating it will dogrunt build
<- :boom: I have this problem too! =( Please help
In Gruntfile js requirejs: {
dist: {
// Options: https://github.com/jrburke/r.js/blob/master/build/example.build.js
options: {
almond: true,
replaceRequireScript: [{
files: ['<%= yeoman.dist %>/index.html'],
module: 'main'
}],
//modules: [{name: 'main'}],
baseUrl: '<%= yeoman.app %>/scripts',
mainConfigFile: '<%= yeoman.app %>/scripts/main.js', // contains path specifications and nothing else important with respect to config
dir: '.tmp/scripts',
optimize: 'none', // optimize by uglify task
useStrict: false,
wrap: true
}
}
},</code>
if you disable line - modules: [{name: 'main'}]
- Build succeeds! But i have error in dist/index.html - require is not defined
I will try to look at it during the weekend.
@marian-r that would be amazing 😊
Sorry for the delay. I didn't managed to look at it over the weekend, so I will give it a try over the next one. Sorry.
+1
Fix submitted in #384. After a bit of investigating, the fix was fairly easy. And sorry for the delay.
:confetti_ball: many thanks @marian-r for fixing it!
I'll publish a new patch release soon.
Hey, I'm curious how I can modify this grunt build script so that all (custom) files are concatenated into a single script. I'm not using RequireJS for the lazy loading but rather for modularization and easy dependency management so I don't really want my release users to require requireJS.
I've attempted to modify my gruntfile to accomplish what I want, but right now I keep running into an issue where the
templates.js
file is being created in/.tmp/scripts/
, but is then is aparrently wiped out / over written by some task which runs after thejst
task. Any ideas/help?Here's my Gruntfile.js: