Menu icon Foundation
Yeti launch > Howto minify production files in /dist?

I started working with Yeti launch en for testing and development it's great. Easy and fast, thanks.
Started a project Foundation for SITES > ZURB template.

The files produced in /dist/assets are not minified.
I want to create minified and optimized files for production. I cannot find how todo that from within Yeti launch. Is that possible? Or what would be the best solution otherwise?

I'v tried with command 'foundation build' in the cli terminal, but that gives errors (see code).

I've tried to solve that also in terminal as advised by:
npm rebuild node-sass
But after that first Yeti launch did not run anymore because of an error. Had to reinstall it.
Now after more attempts:
When I do then 'foundation build' css is minified, but only with the normalize.scss. No other foundation css is included.
I cannot get it to work.
Please advice, help out.

Best option is that Yeti Launch produces the minified production version for css and js. Or has the possibility to do that.
If not I better keep using cli :-(

         MyMac:MyApp USERNAME$ ls
CHANGELOG.md    	bower_components	gulpfile.js		package.json		readme.md
bower.json		dist			node_modules		project.json		src
MyMac:MyApp USERNAME$ foundation build

> foundation-ssg@1.0.0 build /Users/USERNAME/Desktop/MyApp
> gulp build --production

[16:57:04] Using gulpfile ~/Desktop/MyApp/gulpfile.js
[16:57:04] Starting 'build'...
[16:57:04] Starting 'clean'...
[16:57:04] Finished 'clean' after 6.87 ms
[16:57:04] Starting 'pages'...
[16:57:04] Finished 'pages' after 181 ms
[16:57:04] Starting 'sass'...
[16:57:05] 'sass' errored after 562 ms
[16:57:05] Error: The `libsass` binding was not found in /Users/USERNAME/Desktop/MyApp/node_modules/gulp-sass/node_modules/node-sass/vendor/darwin-x64-47/binding.node
This usually happens because your node version has changed.
Run `npm rebuild node-sass` to build the binding for your current node version.
    at Object.sass.getBinaryPath (/Users/USERNAME/Desktop/MyApp/node_modules/gulp-sass/node_modules/node-sass/lib/extensions.js:158:11)
    at Object.<anonymous> (/Users/USERNAME/Desktop/MyApp/node_modules/gulp-sass/node_modules/node-sass/lib/index.js:16:36)
    at Module._compile (module.js:425:26)
    at Object.Module._extensions..js (module.js:432:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at Object.<anonymous> (/Users/USERNAME/Desktop/MyApp/node_modules/gulp-sass/index.js:176:21)
    at Module._compile (module.js:425:26)
    at Object.Module._extensions..js (module.js:432:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at requireFn (/Users/USERNAME/Desktop/MyApp/node_modules/gulp-load-plugins/index.js:40:16)
[16:57:05] 'build' errored after 755 ms
[16:57:05] Error in plugin 'run-sequence'
Message:
    An error occured in task 'sass'.
Error: foundation-ssg@1.0.0 build: `gulp build --production`
Exit status 1
    at EventEmitter.<anonymous> (/usr/local/lib/node_modules/foundation-cli/node_modules/npm/lib/utils/lifecycle.js:214:16)
    at emitTwo (events.js:87:13)
    at EventEmitter.emit (events.js:172:7)
    at ChildProcess.<anonymous> (/usr/local/lib/node_modules/foundation-cli/node_modules/npm/lib/utils/spawn.js:24:14)
    at emitTwo (events.js:87:13)
    at ChildProcess.emit (events.js:172:7)
    at maybeClose (internal/child_process.js:818:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
MyMac:MyApp USERNAME$    

         

yetiproductioncligulp

I started working with Yeti launch en for testing and development it's great. Easy and fast, thanks.
Started a project Foundation for SITES > ZURB template.

The files produced in /dist/assets are not minified.
I want to create minified and optimized files for production. I cannot find how todo that from within Yeti launch. Is that possible? Or what would be the best solution otherwise?

I'v tried with command 'foundation build' in the cli terminal, but that gives errors (see code).

I've tried to solve that also in terminal as advised by:
npm rebuild node-sass
But after that first Yeti launch did not run anymore because of an error. Had to reinstall it.
Now after more attempts:
When I do then 'foundation build' css is minified, but only with the normalize.scss. No other foundation css is included.
I cannot get it to work.
Please advice, help out.

Best option is that Yeti Launch produces the minified production version for css and js. Or has the possibility to do that.
If not I better keep using cli :-(

         MyMac:MyApp USERNAME$ ls
CHANGELOG.md    	bower_components	gulpfile.js		package.json		readme.md
bower.json		dist			node_modules		project.json		src
MyMac:MyApp USERNAME$ foundation build

> foundation-ssg@1.0.0 build /Users/USERNAME/Desktop/MyApp
> gulp build --production

[16:57:04] Using gulpfile ~/Desktop/MyApp/gulpfile.js
[16:57:04] Starting 'build'...
[16:57:04] Starting 'clean'...
[16:57:04] Finished 'clean' after 6.87 ms
[16:57:04] Starting 'pages'...
[16:57:04] Finished 'pages' after 181 ms
[16:57:04] Starting 'sass'...
[16:57:05] 'sass' errored after 562 ms
[16:57:05] Error: The `libsass` binding was not found in /Users/USERNAME/Desktop/MyApp/node_modules/gulp-sass/node_modules/node-sass/vendor/darwin-x64-47/binding.node
This usually happens because your node version has changed.
Run `npm rebuild node-sass` to build the binding for your current node version.
    at Object.sass.getBinaryPath (/Users/USERNAME/Desktop/MyApp/node_modules/gulp-sass/node_modules/node-sass/lib/extensions.js:158:11)
    at Object.<anonymous> (/Users/USERNAME/Desktop/MyApp/node_modules/gulp-sass/node_modules/node-sass/lib/index.js:16:36)
    at Module._compile (module.js:425:26)
    at Object.Module._extensions..js (module.js:432:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at Object.<anonymous> (/Users/USERNAME/Desktop/MyApp/node_modules/gulp-sass/index.js:176:21)
    at Module._compile (module.js:425:26)
    at Object.Module._extensions..js (module.js:432:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at requireFn (/Users/USERNAME/Desktop/MyApp/node_modules/gulp-load-plugins/index.js:40:16)
[16:57:05] 'build' errored after 755 ms
[16:57:05] Error in plugin 'run-sequence'
Message:
    An error occured in task 'sass'.
Error: foundation-ssg@1.0.0 build: `gulp build --production`
Exit status 1
    at EventEmitter.<anonymous> (/usr/local/lib/node_modules/foundation-cli/node_modules/npm/lib/utils/lifecycle.js:214:16)
    at emitTwo (events.js:87:13)
    at EventEmitter.emit (events.js:172:7)
    at ChildProcess.<anonymous> (/usr/local/lib/node_modules/foundation-cli/node_modules/npm/lib/utils/spawn.js:24:14)
    at emitTwo (events.js:87:13)
    at ChildProcess.emit (events.js:172:7)
    at maybeClose (internal/child_process.js:818:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
MyMac:MyApp USERNAME$    

         

Dave Brockmeier gave the most helpful answer for this post
Dave Brockmeier over 3 years ago

In gulp file.js, change:

var isProduction = !!(argv.production);

to

var isProduction = true;

It will run the project through UnCSS and do some incredible CSS voodoo. I think you'll need to stop and restart your server within Yeti. You may also need to make a token modification to an .SCSS file for it to rebuild.

This post has been closed. No new replies can be added.

Tim Hartwick over 3 years ago

Thanks for checking out Yeti Launch! We plan on implementing this in a future patch! We'll also be adding the ability to upload directly to Notable Code with this patch too.

Hang in there!

Dave Brockmeier over 3 years ago

In gulp file.js, change:

var isProduction = !!(argv.production);

to

var isProduction = true;

It will run the project through UnCSS and do some incredible CSS voodoo. I think you'll need to stop and restart your server within Yeti. You may also need to make a token modification to an .SCSS file for it to rebuild.

Rafi Benkual over 3 years ago

I think it does this through the regular Gulp template. @ericm Can you confirm?

Erik M over 3 years ago

It does indeed do it through the gulp template. Dave Brockmeier's solution is probably the best one until we add this feature in yeti launch.

Erwin Bot over 3 years ago

Thanks! I can confirm this works fine.