wellington / grunt-wellington

Grunt wrapper for wellington
MIT License
3 stars 2 forks source link

Support for a shared src/files configuration #11

Open pierceray opened 8 years ago

pierceray commented 8 years ago

In a lot of plugins I have seen there is a concept of a shared options/files in the Gruntfile.js. The location of my sass files doesn't really change, but my config options do change per target (e.g. dev vs. prod). It would be nice to support this.

I'm not sure of the reason, but most use "files" for the shared portions, and "src" for the targets.

An example Grunt config might look like:

wellington: {
    files: [
        'src/sass/**/*.scss'
    ],
    dist: {
        options: {
            p: 'src/sass',
            b: 'dist/css',
            d: 'dist/img',
            font: 'font-face',
            gen: 'dist/img/sprites'
        }
    },
    dev: {
        src: [
            'src/path/to/more/files/**/*.scss'
        ],
        options: {
            p: 'src/sass',
            b: 'src/css',
            d: 'src/sprites',
            font: 'font-face',
            gen: 'src/img/sprites'
        }
    }
};
drewwells commented 8 years ago

So depending on your environment, the source files changes?

pierceray commented 8 years ago

Actually opposite of that. The source stays the same but output destination changes.

Ray Pierce

Sent from my iPhone

On Dec 5, 2015, at 1:31 AM, Drew Wells notifications@github.com wrote:

So depending on your environment, the source files changes?

— Reply to this email directly or view it on GitHub.

drewwells commented 8 years ago

Ahh, so we need some sort of build environment variable. If I recall correctly, grunt has some support for these. wt has smart or fast cache busting strategies now, that might be useful for environment specific builds too.