Comments (8)
I like it! :)
Would be happy to review a PR introducing that.
from webpack-blocks.
And thanks for sharing your idea, @marcofugaro
from webpack-blocks.
Negations can happen anywhere in a pattern, how are we going to handle it? Is it going to be predictable?
And also glob-to-regexp
doesn't support many glob features including negations.
from webpack-blocks.
Negations can happen anywhere in a pattern
Really? I was thinking about the negation of the whole pattern (!
in the very front) only. Just as a nicer way to specify exclusions.
And also glob-to-regexp doesn't support (...) negations
True, but could quite easily be worked around by doing this, I think:
const negations = patterns.filter(pattern => pattern.startsWith('!')).map(pattern => pattern.substr(1))
match.test = patterns.filter(pattern => !pattern.startsWith('!')).map(regexify)
match.exclude = options.exclude.concat(negations.map(regexify))
(If it starts with a !
, then strip it, regexify as usual, but append to match.exclude
instead of match.test
)
from webpack-blocks.
Yes, I think that's it's way too much overhead to support also negations anywhere in a pattern.
Probably not worth it since negations are always used at the start.
from webpack-blocks.
By the way, @andywer do you think we still need to support the options
parameter (the second one) in the match()
?
from webpack-blocks.
Good question. I would keep it, since it doesn't cost us anything except maintenance of a couple of LOC. There might still be scenarios where you want to pass a more elaborate include/exclude configuration.
But no hard feelings either way.
from webpack-blocks.
Alright, done it. It was a pain to handle all the cases.
from webpack-blocks.
Related Issues (20)
- Have setOutput accept an object HOT 1
- Add tsd HOT 7
- createConfig from available webpack base config HOT 6
- Support for webpack 4 HOT 34
- @webpack-blocks/babel-loader: how to disable exclude node_modules HOT 12
- Code style HOT 6
- 2.0 roadmap HOT 26
- Move unpopular blocks to the webpack-blocks org HOT 11
- uglify package 1.0.0 doesn't match what is in the npm registry HOT 3
- Using assets package with webpack 4 and babel7 HOT 1
- Webpack blocks for webpack ^4.0.0 and babel ^7.0.0 HOT 2
- How to create custom block with new version? HOT 1
- Update typescript block to work with webpack 4 HOT 4
- Ability to extend options passed to include configFile HOT 3
- Tag a new version for update peer dependencies commit HOT 1
- devserver: hot and HotModuleReplacementPlugin
- Outdated PostCSS README HOT 1
- Cannot see how to remove or filter out HotModuleReplacementPlugin
- webpack-blocks/* issue 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 webpack-blocks.