I want to copy the static file in webpack 5.x, so I install the webpack copy plugin "copy-webpack-plugin": "^10.2.1", and added config like this:
new CopyPlugin({
patterns: [
{ from: "src/manifest.json", to: "manifest.json" },
{ from: "src/resource/image", to: "/resource/image" },
],
}),
what I am trying to do is copy the image folder from source folder to dist folder and keep the folder structure. But when I run the webpack command and shows error like this:
ā reddwaf-translate-plugin git:(main) ā npm run dev
> reddwaf-translate-plugin@1.0.0 dev
> rm -rf src/bundle && webpack --mode development --config src/resource/config/webpack.dev.config.js
[webpack-cli] [Error: EROFS: read-only file system, mkdir '/resource'] {
errno: -30,
code: 'EROFS',
syscall: 'mkdir',
path: '/resource'
}
I am sure the filesystem is not read only because I have created files and folder. why did this happen? what should I do to fix it? The current operation system is macOS Monteney with M1 pro chip.