-1

Assuming that I have the following config.js file containing an object

module.exports = {
    css: {
        src: './src/sass/**/*.scss',
        dist: './dist/css/',
        watch: './src/sass/**/*.scss',
    }
}

I have two identical values for css.src and css.watch; how can I modify this to correctly set the value of watch to be equal to src without having to write that value again?

Sekhemty
  • 1,222
  • 2
  • 13
  • 33

1 Answers1

-2

Use variables to refer same value or below

module.exports = {
        css: {
            src: './src/sass/**/*.scss',
            dist: './dist/css/',
            watch: module.exports.css.src
        }
    }
William Brain
  • 104
  • 1
  • 1
  • 8