Gulp Build

From the looks of it, the only difference between gulp and gulp build is the clean task.

Is that correct? I’d like to modify my gulp file so on build it creates a main.min.css file which I’ll track for git deployment.

Should I be modifying the manifest.json file for that?

Thanks!

Actually, the regular gulp task cleans and the gulp build task doesn’t.

I’d probably make a new task in the gulpfile just to copy everything over if you really wanted a main.min.css file, but why not just check /dist/ into version control?

edit: oops, sorry - I read it wrong and thought you were saying that gulp build ran the clean task! You were correct that that is the difference.

1 Like

The only reason I don’t want to track the entire dist folder is because of merge conflicts. By only tracking the build or production file versions that would cut down on those issues.

I see now that gulp build --production does create the assets.json file and builds new file versions but their filenames are randomized, and I wouldn’t be able to track those. Unless I do an exclude.

If you want to check something in and not have it revved just change this here:

https://github.com/roots/sage/blob/master/gulpfile.js#L43

// rev: argv.production,
rev: false,

As an aside: I wrote a general purpose article about how to get build artifacts to the server

1 Like

@austin: Thanks, I’m seeing that feature now. With this setup is there a way to build a main.min.css type file rather than main.css being the one I check into source?

Committing that while working on a project with other developers can cause quite a few merge conflicts. Committing only on build would cut that down.

Thanks!

@emaildano Committing “binaries” to a project is going to cause you trouble no matter what. So I definitely recommend seeking alternate deployment options that do not rely on committing compiled files to the repo.

You can use some of the ideas in this reply: Sage and augmenting my workflow