Comments (6)
What I'd prefer to do is something along the lines of...
import copyStaticFiles, { filter } from 'esbuild-copy-static-files'
const EXCLUDED_FILES = [...]
function excludeFilter(src, dst) {
if (EXCLUDED_FILES.find(f => src === f) {
return false;
}
return filter(src, dst)
}
...
plugins: [
copyStaticFiles({ filter: excludeFilter })
]
}
from esbuild-copy-static-files.
Yep! Feel free to open a PR if you want to arrive at a solution that lets you:
- Define a custom filter function (current behavior)
- Augment / extend the existing filter function with a new filter function of your choosing
from esbuild-copy-static-files.
Hi,
If you were to re-implement the filter function what would it look like?
from esbuild-copy-static-files.
Otherwise, to cover my use case, I'd end up duplicating all of your filter()
code and the functions it depends on into my external function just to pass it back in to your scope as an argument.
from esbuild-copy-static-files.
Yes - I think this would be an excellent addition - exporting the filter
function to be able to re-use it is very useful.
from esbuild-copy-static-files.
Ha, I'm actually looking into re-using the filter
function and I've just realised that 90% of this plugin is the filter
function and its dependencies.
from esbuild-copy-static-files.
Related Issues (3)
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 esbuild-copy-static-files.