carrot / roots-webpack

webpack extension for roots
Other
6 stars 1 forks source link

Ignore required root and tree #2

Open jescalan opened 9 years ago

jescalan commented 9 years ago

Just like browserify, if webpack is handling the asset roots should ignore it. So we need to get the require tree out of webpack and make sure roots isn't also compiling it!

hhsnopek commented 9 years ago

So unlike browserify, we can't get access to the assets until after the first compile/watch. I know that @slang800 has mentioned this in the past, but if we used assetgraph or something similar to get all the assets prior to compilation, we can ignore the ones being compiled by "x plugin" by analyzing the file being passed into the plugin.

Currently I have the fileDependencies being ignored after the first pass through the compiler. I'm unsure if living editing the config file will affect the ignored files though. see https://github.com/carrot/roots-webpack/blob/ignores/lib/index.coffee#L34

hhsnopek commented 9 years ago

this could work as well for analyzing a project: https://github.com/pahen/madge

jescalan commented 9 years ago

I suppose after the first compile is the best we can do, still not the best approach overall though. Madge looks pretty good, maybe we can give that a shot? I wonder if it would mean a significant slowdown. Then again, we could just use madge on the first shot, and fileDependencies for any passes after this.

If we could just get something in place for the first pass, the files wouldn't be generated into the output, and it presumably would represent a speed increase overall and less messy output...