Comments (12)
@CPatchane I believe so, will check later this week, thank you
from rollup-plugin-copy.
I'd search for a plugin to change contents of a file so the workflow is this:
- npm run dev
- files copied to
dist
- plugin replaces contents in this
dist
index.html
file
or another plugin to process index.html
file separately
- npm run dev
- files copied to
dist
, but notindex.html
index.html
is processed with another plugin and saved indist
folder
May help:
https://www.npmjs.com/package/rollup-plugin-string-replacer
https://www.npmjs.com/package/rollup-plugin-replace-html-vars
What do think about this options?
Alternatively, in the next version a target object will have src
, dist
and rename
properties. I can think about adding replace function with similar functionality if nothing else works 🤔
from rollup-plugin-copy.
@vladshcherbin I'm happy to see you answer right away.
My needs are fairly basic.
I could do all the operations with external cli, eliminating the use of rollup plugins.
But I saw that yours is great and I would like to expand it with these features which, I repeat, I consider basic for the development of a web application.
Now I'm using https://github.com/haifeng2013/rollup-plugin-bundle-html but as you can see in the issues there are a few problems.
In general it would be useful that in the development phase (without hash in file name) there is an index that is written (even only the first time) and that contains the .js and .css inject.
In the production phase obviously the bundles will have the hash in the name and therefore inject is with the hash.
I think your plugin needs to extend the functionality by adding this.
Thank you for your work.
from rollup-plugin-copy.
@frederikhors how about a transform
option to give you contents or filename so you can use functions/packages to change it? Something like this:
copy({
targets: [{
src: 'src/index.html',
dest: 'dist',
transform: contents => contents.replace('%BundleNameVarFromRollup%', 'app.js')
}]
})
from rollup-plugin-copy.
Yes, something like this.
I need to use src without hash in file name in development and hashes in production bundles.
from rollup-plugin-copy.
@vladshcherbin is it possible to get the hash of the file from rollup? Maybe choosing a final hook?
from rollup-plugin-copy.
@frederikhors using a separate plugin I believe, currently no tools for this in rollup-plugin-copy
from rollup-plugin-copy.
@vladshcherbin Closing this issue would make rollup-plugin-copy
essential to any rollup project. The non-plus-ultra.
from rollup-plugin-copy.
Unable to copy file to destination folder
from rollup-plugin-copy.
OK,I know.This must use an absolute path
from rollup-plugin-copy.
Is #31 fixing the issue here?
from rollup-plugin-copy.
Transform feature was released in 3.3.0 with the help of @CPatchane 🎉
from rollup-plugin-copy.
Related Issues (20)
- Is there the ability to transform the files within the input directory? HOT 1
- Transform doesn't work without Rename HOT 1
- Transform only works on first instance of file HOT 1
- 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 plugin) Error: ENOENT: no such file or directory, chmod <filename> HOT 7
- 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
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.