Note that there are some explanatory texts on larger screens.

plurals
  1. POGrunt/Yeoman Multiple Gruntfile.js Files
    primarykey
    data
    text
    <p>My goal is the be able to build my project to two separate build folders, each with its' own Grunt tasks.</p> <p>I noticed the <code>grunt-cli</code> has the <code>--gruntfile</code> option which allows you to specify another Gruntfile to use. So far, I have a <code>Gruntfile.js</code> working perfectly (near stock from Yeoman). Also, I have another <code>Gruntfile2.js</code> sitting alongside.</p> <p><strong>Gruntfile.js</strong></p> <pre><code>var yeomanConfig = { app: 'app', dist: '../www_browser' }; </code></pre> <p><strong>Gruntfile2.js</strong></p> <pre><code>var yeomanConfig = { app: 'app', dist: '../www' }; </code></pre> <p><code>grunt build</code> is meant to run Gruntfile.js, and does so perfectly.</p> <p><code>grunt build --gruntfile Gruntfile2.js</code> is meant to run <code>Gruntfile2.js</code>, and does so with some hiccups. (supposed to build to <code>../www</code> folder NOT <code>../www_browser</code> folder)</p> <p>The --gruntfile directive builds to the proper folder for almost every task except <strong>grunt-usemin</strong> and <strong>gunt-contrib-htmlmin</strong>. I know this because of this output to the console here: </p> <pre><code>Running "usemin:css" (usemin) task Processing as CSS - ../www_browser/styles/22f60055.main.css Running "concurrent:dist" (concurrent) task Running "htmlmin:dist" (htmlmin) task File ../www_browser/404.html created. File ../www_browser/index.html created. </code></pre> <p>You'll notice the <strong>../www_browser</strong>, here in console output. Every other task runs in the expected <strong>../www</strong> folder. </p> <p>Is this a usemin cache thing? Grunt cache thing? Or do some tasks simply run from the default Gruntfile.js regardless of the <code>--gruntfile Gruntfile2.js</code> directive?</p> <p>I have given up on trying to do multiple targets from a single Gruntfile for now. There are too many dependencies in Yeoman's Gruntfile.js that don't yet support multiple build targets, and I spent 12 hours to no avail with that approach. </p> <p><strong>Version Info</strong></p> <pre><code>$: grunt --version grunt-cli v0.1.9 grunt v0.4.1 $: npm --version 1.2.25 $: yo --version 1.0.3 </code></pre> <p><strong>package.json</strong></p> <pre><code>{ "name": "myapp", "version": "0.0.0", "dependencies": {}, "devDependencies": { "grunt": "~0.4.1", "grunt-contrib-copy": "~0.4.1", "grunt-contrib-concat": "~0.1.3", "grunt-contrib-coffee": "~0.6.5", "grunt-contrib-uglify": "~0.2.0", "grunt-contrib-compass": "~0.2.0", "grunt-contrib-jshint": "~0.4.1", "grunt-contrib-cssmin": "~0.6.0", "grunt-contrib-connect": "~0.2.0", "grunt-contrib-clean": "~0.4.0", "grunt-contrib-htmlmin": "~0.1.3", "grunt-bower-requirejs": "~0.4.1", "grunt-contrib-requirejs": "~0.4.0", "grunt-contrib-imagemin": "~0.1.3", "grunt-contrib-watch": "~0.4.0", "grunt-rev": "~0.1.0", "grunt-usemin": "~0.1.10", "grunt-mocha": "~0.3.0", "grunt-open": "~0.2.0", "grunt-svgmin": "~0.1.0", "grunt-concurrent": "~0.1.0", "matchdep": "~0.1.1", "connect-livereload": "~0.2.0" }, "engines": { "node": "&gt;=0.8.0" } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload