bspaulding / rollup-plugin-image-files Goto Github PK
View Code? Open in Web Editor NEWLike rollup-plugin-image, but writes image files to dest instead of inlining base64.
License: MIT License
Like rollup-plugin-image, but writes image files to dest instead of inlining base64.
License: MIT License
I'm using this in a library which builds to dist/esm/
and dist/cjs/
. This plugin fails for nested output directories.
The images are placed in root dir now.
Hello,
is their any way to move images into sub directory ? Currently its directly placing in the same folder.
like images({ extract: "public/images" })
,
I'd like to put my image files into a subdirectory but this doesn't seem to be possible at the time.
I'd expect to be able to pass options like
imageFiles({
dir: "./assets"
})
which would then be appended using path.resolve
to the path which is currently used/extracted from the rollup config.
Is there anything which would speak against it or would a PR be appreciated?
Tried including this in my rollup.config.js using
import images from 'rollup-plugin-image-files'
and also included 'image()' in the plugins section. Even without trying to import any image, it throws this error:
[!] TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string
at assertPath (path.js:39:11)
at Object.dirname (path.js:1331:5)
at Object.ongenerate (/home/me/my-components/my-component/src/node_modules/rollup-plugin-image-files/dist/index.cjs.js:37:21)
at /usr/local/lib/node_modules/rollup/dist/rollup.js:19615:40
at Array.forEach (<anonymous>)
at /usr/local/lib/node_modules/rollup/dist/rollup.js:19613:41
at <anonymous>
Right now, writing out files will happen before rollup has created the dest directory. We should probably handle this case and not explode.
Hey there. I'm currently leading the effort to migrate all of the "official" Rollup plugins into a monorepo at https://github.com/rollup/plugins. rollup-plugin-image
is next on my list, and part of the migration is going to be adding some missing features that have long been requested. I was to curios to know if you're interested in integrating this plugin into the @rollup/plugin-image
plugin. Cheers.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.