Closed pengx17 closed 8 years ago
Use ES6 descturctors:
{
...require('./config/colors'),
...require('./config/layout')
}
How would that look like in the example above? I can't get it to run with multiple files
What error do you have?
See my example:
require('postcss-simple-vars')({ variables: function variables() { return require('../src/file1') }, unknown: function unknown(node, name, result) { node.warn(result, 'Unknown variable ' + name) } }),
How exactly do I insert a second file after return require('../src/file1')
so that e.g file1 and file2 are used
variables: {
...require('./config/colors'),
...require('./config/layout')
}
Yeah, sorry - I missed a require in the second file. Thank you for you quick response and help :)
E.g., if I have two JS files containing two sets of variables:
Can I inject the two set of variables?