Comments (7)
Same here. For some reason it fails to chmod
a copied file.
And for me it fails sporadically, without any pattern, which suggests a race condition.
I have "rollup-plugin-copy": "3.4.0"
from rollup-plugin-copy.
@gunnartorfis I just copied the source and tweaked a little. Just added try catch block Here
from rollup-plugin-copy.
Happening to me as well. Any ideas for a workaround?
In my case, I'm copying JSON localization files over to the dist folder after a build.
from rollup-plugin-copy.
are you by chance using del
, or any plugin that cleans the output directory? I started seeing the error when I added that. One solution would be to ensure that copy runs after del
, and that both use the same buildEnd
hook:
del({
targets: ['./.dist', './public'],
hook: 'buildEnd',
runOnce: true
}),
copy({
targets: [{ src: 'prebuilt/*', dest: 'public/' }],
hook: 'writeBundle',
copyOnce: true
})
If that doesn't work, fork the package and add:
if (!fs.existsSync(path.dirname(dest))) {
fs.mkdirSync(path.dirname(dest), { recursive: true });
}
before the copy, to ensure that the directory is created before attempting to copy it. Fyi, that should solve any issues with this package.
from rollup-plugin-copy.
Can someone provide a reproduction repo? I'll try to find the underlying reason 🙌
from rollup-plugin-copy.
I can provide one, though I'm currently using the fork I created(see the linked PR above), and I haven't seen this issue since.
Basically add this to any package's rollup config:
const del = require('rollup-plugin-delete');
export const config = {
input: './index.js',
output: {
sourcemap: true,
dir: './.dist',
format: 'esm'
},
copy({
targets: [{ src: 'prebuilt/*', dest: 'public/' }],
copyOnce: true
}),
del({
targets: ['./.dist', './public'],
hook: 'buildEnd',
runOnce: true
})
}
And ensure there is something in the prebuilt
folder to copy. I believe it should fail, because the folder does not exist, since the del
hook removed it.
If you need a full repro, I can also provide a repo for that, though again, #71 fixes this issue for me.
from rollup-plugin-copy.
@DanielOrtel thank you, will try locally
from rollup-plugin-copy.
Related Issues (20)
- Promise support
- Negated patterns doesn't work correctly. HOT 1
- Has anyone been able to get this working in Sveltekit yet? HOT 3
- copy folder structure with flatten=false and ignore first levels HOT 3
- No error if target file does not exist
- The filter won't take effect when file transformed
- copy occurs before generated bundle write when multi entry HOT 2
- unable to copy dot files from a directory ie. .htaccess HOT 1
- Symlinks HOT 2
- Move `@types/*` to `devDependencies`. HOT 3
- Create symlink instead of copy?
- Not working well in a Laravel project using Vite HOT 2
- The files in src cannot be obtained under the windows system HOT 3
- Rename does not let me alter the folder to which the file is written. HOT 1
- Please add your oss license text HOT 1
- `rename` option does not work in Rollup 4 HOT 1
- Compile typescript HOT 1
- Breaking dependency [email protected] HOT 3
- [Question] Is it possible to copy to a "hidden" folder?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rollup-plugin-copy.