Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

Add dependency message #58

Open
ai opened this issue Oct 8, 2016 · 6 comments
Open

Add dependency message #58

ai opened this issue Oct 8, 2016 · 6 comments

Comments

@ai
Copy link
Contributor

ai commented Oct 8, 2016

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.

@ai
Copy link
Contributor Author

ai commented Nov 5, 2016

@borodean do you need any help?

@borodean
Copy link
Owner

borodean commented Nov 5, 2016

@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.

@ai
Copy link
Contributor Author

ai commented Nov 5, 2016

Sure, what is your main problem with support/release process?

@borodean
Copy link
Owner

borodean commented Nov 7, 2016

@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:

  1. 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.
  2. What should the parent parameter contain? I haven't found it mentioned in neither postcss-loader source code nor Webpack docs.
  3. Since the plugin delegates its function handling to postcss-function it has no access to the result at 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.

@ai
Copy link
Contributor Author

ai commented Nov 7, 2016

parent should contains Node#source.input.file

@ai
Copy link
Contributor Author

ai commented Nov 7, 2016

It is not so important right now, we could wait :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants