Closed jrop closed 7 years ago
Thanks for letting us know @jrop. Would you be interested in helping us with Webpack 2 compatibility? We are happy to receive contributions. Thanks, again.
I would be; I started looking into what I would do to create a pull-request, however, I am unfamiliar with the internals of webpack at the moment.
Ok, if you are able to figure it out that would be awesome. I am also unfamiliar with the internals of Webpack, but @mlrawlings did spend a lot of time getting this loader to work (he probably won't be able to take a look until later this week).
Just to keep this issue up to date: I created a pull request in which I pulled in the ResultSet.js file from webpack's source: this file is responsible for finding matching rules based on a file, so it replaces getMatchingLoader(...)
. Why not just require('webpack/lib/ResultSet')
? Well, if we want to support webpack 1.x, this file does not exist in the webpack source, so I opted to pull it into this modules source. This could probably be opened for discussion, as I could see pros/cons of doing it this way.
Thanks for the PR @jrop! Very much appreciated. I'm going to ask @mlrawlings to review the PR tomorrow when he is available since he worked on the first version of marko-loader
.
I'm going to go ahead and close out this issue. This should be resolved in PR #14. Let me know if you still see any issues.
As of webpack 2.x, loaders are now specified as rules:
When an inline style is used with less (
style.less {...}
) The marko-loader only searches throughoptions.module.loaders
for theless-loader
.This may be non-trivial to fix, because loader rules are more complex in webpack 2.0, and the logic in
marko-loader/index.js:getLoaderMatch()
may have to be significantly more complex to support rules.