Very basic rollup plugin to copy static assets over to you public directory. Files are copied using cpy
This package can be installed using npm:
npm install rollup-plugin-cpy2
Add the following lines to your rollup.config.js
:
import copy from 'rollup-plugin-cpy2';
...
export default {
...
plugins: [
...
copy({
src: ['**/*.less'],
dest: path.resolve(__dirname, '../es/'),
options: {
cwd: path.resolve(__dirname, '../src/components/'),
parents: true,
rename: basename => `style/${basename}`,
},
}),
...
]
...
}
src
:<array>
: glob style filenamesdest
:<string>
: assets to copy tooptions
:<object>
: cpy config optionscwd
:<string>
: Working directory to find source files. (default isprocess.cwd()
)parents
:<boolean>
: Preserve path structure. (default isfalse
)rename
:<string|function>
: Filename or function returning a filename used to rename every file in files. (default isnull
)