Comments (13)
That's cool.
from blendid.
I took it a step further in my fork. I added a userconfig-example.json and added userconfig.json to gitgnore. So it's possible to rename userconfig-example to userconfig.json and override some user specific parameters, for example browserSync proxy. In my config.json are project specific settings, in the userconfig.json user specific settings for their local environment.
Just as an input.
https://github.com/whatwedo/gulp-wp-theme/tree/develop/gulp
from blendid.
👍 to this.
Combining this with @renestalder's user-config would be nice. So, simply merge the default config with user-specific config, which is added to .gitignore.
from blendid.
I definitely 👍 the idea of a .gitignored userconfig + default example included in the repo. Extending might be nice but then you'd have defaults in one file and user config'd stuff in another file... I might personally prefer just one config file i.e. default exists, copy it and rename to userconfig and then edit.
from blendid.
@solomonhawk @tommymarshall Yeah, I recognised my solution isn't perfect because I take the default parameters out of the example config (similar to WordPress where the example config is needed for the installation), instead out of the config.json where I could define defaults.
But I wanted a strict separation between user specific parameters and project parameters. For example, folder structure for builds should be project wide while browserSync settings for browser and proxies could be user specific. All defaults in the config.json is okay, but IMHO not all should be changeable by the user settings.
from blendid.
I like this, and agree it's a good idea. I've been meaning to do this for a while. For the sake of simplicity, (this is just a starter repo) I'll just add a single config file.
from blendid.
Loving this idea, @solomonhawk!
Do you guys see a benefit in making this a module instead of JSON?
- Both JSON files and modules can be
require
d - a module can be coffee, js or JSON
- a module lets you re-use variables and do useful things such as
# gulp/config.coffee
dest = './build/'
src = 'src'
module.exports =
sass:
src : "#{src}/sass/*.{sass, scss}"
dest: dest
images:
src : "./#{src}/images/**",
dest: "#{dest}/images"
These seem like very valuable benefits at virtually no cost, right?
from blendid.
I agree entirely, module seems like the way to go
On Sep 7, 2014, at 10:30 AM, Andreas Pizsa [email protected] wrote:
Loving this idea, @solomonhawk!
Do you guys see a benefit in making this a module instead of JSON?
Both JSON files and modules can be required
a module can be coffee, js or JSON
a module lets you re-use variables and do useful things such asgulp/config.coffee
dest = './build/'
src = 'src'module.exports =
sass:
src : "#{src}/sass/*.{sass, scss}"
dest: destimages:
src : "./#{src}/images/**",
dest: "#{dest}/images"
These seem like very valuable benefits at virtually no cost, right?—
Reply to this email directly or view it on GitHub.
from blendid.
I've been using my config as a module for a while, one of the benefits i like is able set options and default values for variables.
I use it with yargs so you can specify your dist when running your gulp task in term
args = require("yargs").argv
buildDir = args.dir ? "dist"
module.exports =
build:
root : "#{buildDir}"
folders:
fonts : "#{buildDir}/fonts"
image : "#{buildDir}/images"
...
from blendid.
@adrianchen19888 Oh nice! Yargs looks great.
from blendid.
I'll use that when I add dist/production tasks.
from blendid.
Done. Thanks @AndreasPizsa and everyone who contributed to the conversation!
from blendid.
Just reading up on all this. Nice work! 👍 to reducing repetition of of paths and the module implementation!
from blendid.
Related Issues (20)
- watch task will not compile more than 48 html files HOT 5
- Removing "comments" from public/html files HOT 1
- xlink:href being deprecated in SVG
- Additional Tasks information HOT 4
- Build issue: UglifyJs - Unexpected token: name (context)
- Build issue: UglifyJs - Unexpected token: name (context) HOT 5
- Fonts aren't copied over on build HOT 1
- additionalTasks access rev-manifest HOT 4
- Not bundle jquery in production HOT 1
- Current project status HOT 4
- 4.5.0 release not available through npm/yarn HOT 1
- Failed to mount component: template or render function not defined HOT 1
- upgrade to gulp 4
- empty prebuild and postbuild configs must be `null`/`false`, not `[]`. change this behavior?
- html watch task does not notice changes to files added after Blendid was started
- wrong generation of path for js-files in rev-manifest on windows HOT 1
- Configuration for swiper to work
- The engine "node" is incompatible with this module HOT 3
- 4.5.3 release not available through npm HOT 1
- ERROR in bundle.js from UglifyJs Unexpected token: name (ChangeDesc) [bundle.js:2900,6]
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from blendid.