You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We used SRL with Webpack 3, and it worked well both on Windows and Ubuntu. After we upgraded Webpack from 3 to 4, there is a significant improvement for incremental build speed on Ubuntu. But for windows, this is not the case. It took ~30s for every incremental build on windows. Through examining the Webpack log and some simple tests, we found that SRL caused .less files to rebuild on every incremental build. Here is the minimal reproducible repo with two branches, one use SRL, and one use @import to load the baseStyle.less file.
After some debugging, we found that SRL uses glob to match the patterns option and returns Unix style file path like D:/you/path/to/less/file.less. It then adds this Unix style file path to the dependency list of the current module. While the needRebuild method which controls the cache behavior of Webpack uses windows style file path on windows.
TheneedRebuild method has two parameters: fileTimestamps and contextTimestamps, which both are filePath -> timestamps Map. The keys of these two Maps are windows style file path like D:\\you\\path\\to\\less\\file.less, and the values are timestamps when the corresponding file was updated.
Due to the mismatch of these two file path styles, the needRebuild method returns false every time and thus .less files rebuild on every incremental build.
The text was updated successfully, but these errors were encountered:
We used SRL with Webpack 3, and it worked well both on Windows and Ubuntu. After we upgraded Webpack from 3 to 4, there is a significant improvement for incremental build speed on Ubuntu. But for windows, this is not the case. It took ~30s for every incremental build on windows. Through examining the Webpack log and some simple tests, we found that SRL caused .less files to rebuild on every incremental build. Here is the minimal reproducible repo with two branches, one use SRL, and one use @import to load the baseStyle.less file.
After some debugging, we found that SRL uses glob to match the patterns option and returns Unix style file path like
D:/you/path/to/less/file.less
. It then adds this Unix style file path to the dependency list of the current module. While the needRebuild method which controls the cache behavior of Webpack uses windows style file path on windows.The
needRebuild
method has two parameters:fileTimestamps
andcontextTimestamps
, which both arefilePath -> timestamps
Map. The keys of these two Maps are windows style file path likeD:\\you\\path\\to\\less\\file.less
, and the values are timestamps when the corresponding file was updated.Due to the mismatch of these two file path styles, the
needRebuild
method returns false every time and thus .less files rebuild on every incremental build.The text was updated successfully, but these errors were encountered: