postcss-assets
postcss-assets copied to clipboard
Add dependency message
New postcss-loader will support dependency message to notify webpack about imports. So we need to add few lines on every import:
result.messages.push({
type: 'dependecy',
parent: currentFilePath,
file: absoluteFilePath
})
@borodean it is not really necessary for images plugins. But I think it will be good to have it here too.
@borodean do you need any help?
@ai sorry for being so slow at support. I guess I need some advice on how to organize the whole support/release process better.
Regarding the issue itself: I'll check it out again this weekend and let everyone know if there is anything standing between the current state and releasing this.
Sure, what is your main problem with support/release process?
@ai thanks, I'll create a separate issue on the process improvement.
Regarding this particular feature I've started a branch: https://github.com/assetsjs/postcss-assets/compare/feature/58-dependency-messages. Unfortunately, it doesn't work and I'm being blocked by several thingies:
- The problem is that the assets core library provides no way to retrieve the original file path of the resolved asset. I'd be grad if anyone helps me sorting it out and implementing properly. I don't expect myself to have enough time to develop it in the nearest future. However, I'd happily guide anyone who's interested.
- What should the
parentparameter contain? I haven't found it mentioned in neitherpostcss-loadersource code nor Webpack docs. - Since the plugin delegates its function handling to
postcss-functionit has no access to theresultat the moment output is applied. So, I've tried to collect the messages while resolving functions, and after everything is done push them at once. You may check how it works on that branch. However, I'm concerned about the validity of this approach.
parent should contains Node#source.input.file
It is not so important right now, we could wait :)