postcss-copy
postcss-copy copied to clipboard
Assets not copied when using node
I can't find a way to have postcss-copy works with pure node. Here is my code:
let postcss = require('postcss');
postcss({
plugins: [
require('postcss-copy')({
dest: 'dist',
basePath: '.'
})
]
}).process('.foo{background-image: url(./foo.png);}').then(function(data) {
console.warn(data);
});
foo.png is present in '.' and is not copied to 'dist', Plus, postcss returns a warning in its output:
[ Warning {
type: 'warning',
text: 'Path must be a string. Received undefined',
line: 1,
column: 6,
node: [Object],
plugin: 'postcss-copy' } ],
What am I doing wrong?