Comments (7)
/cc @sokra
from webpack-sources.
ConcatSource
optimizes children internally after adding items. So removing
might sometimes won't work as expected.
Anyway Source
s are intended to be immutable after initial generation. remove
doesn't fit good into the design.
Avoid adding items at first place. You can use an array to construct the items and add them to the ConcatSource
after done.
from webpack-sources.
What do you mean, please clarify
from webpack-sources.
@evilebottnawi because I see ConcactSource
have children is an array, when I want to remove an item from list but a must-do manual. If we support add method I think we support remove method too.
from webpack-sources.
@lamhieu-vk can you provide example of code, thanks
from webpack-sources.
@evilebottnawi for example, in plugin A do something and set assets is a ConcactSource
have children like
const asset = ConcactSource {
children: [
'code1 - is a header comment',
'code2',
'code3 - is a source map',
],
}
in my plugin, I want to have a way to remove children in ConcactSource
from plugin A return, for example:
// remove comment header
asset.remove(0);
// or remove source map
asset.remove(2);
from webpack-sources.
@sokra can you tell me anything?
from webpack-sources.
Related Issues (20)
- TypeError: value.split is not a function HOT 1
- ConcatSource.js:42 failing with Cannot read property 'source' of undefined HOT 2
- res.code is generated code and not Source.prototype.source()
- Content and Map of this Source is not available (only size() is supported) webpack5 HOT 1
- TypeError: Cannot read property 'length' of null HOT 6
- "Maximum call stack size exceeded" in streamChunks* HOT 110
- applySourceMap for webpack 4 is super slow HOT 3
- How to use this library to generate source map to a loader. Is there any guide or example? HOT 1
- Source.Replace can't replace all HOT 20
- ng build success but throwing error on ng serve -- return new error HOT 5
- ReplaceSource.js:82 this._source.node is not a function HOT 5
- Expose _name as public property HOT 11
- last version webpack-sources consuming [email protected] HOT 2
- How to replace the RawSource's value ? HOT 1
- UnhandledPromiseRejectionWarning: Error: "." is not in the SourceMap (reproducible) HOT 4
- Error: "." is not in the SourceMap. HOT 1
- HookWebpackError: item.node is not a function HOT 10
- webpack-sources' Source type is not assigneable to webpack5 source type HOT 11
- why sourceAndMap columns: false is different with columns: true HOT 1
- [question] why ReplaceSource.map.sourcesContent not change 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-sources.