File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,11 @@ In both examples Webpack would output:
4141
4242## Installation
4343``` bash
44+ // For Webpack v3.x
4445npm install --save-dev webpack-omit-js-for-css-plugin
46+
47+ // For Webpack v2.x
48+ npm install --save-dev webpack-omit-js-for-css-plugin@1.0.2
4549```
4650## Usage
4751
Original file line number Diff line number Diff line change @@ -54,12 +54,12 @@ OmitJSforCSSPlugin.prototype.findOmissibleFiles = function(compilation) {
5454 } ) ;
5555
5656 // Each entry point will have its own dependencies, based on the files inner deps or the array deps in entry
57- chunk . modules . forEach ( module => {
57+ chunk . forEachModule ( module => {
5858 if ( ! Array . isArray ( module . fileDependencies ) ) {
5959 return ;
6060 }
6161 module . fileDependencies . forEach ( filepath => {
62- if ( ! resourceOrigin [ filepath ] && ! / ( \b n o d e _ m o d u l e s \b ) / . test ( filepath ) && / \. ( c s s | j s ) / g. test ( filepath ) ) {
62+ if ( ! resourceOrigin [ filepath ] && ! / ( \b n o d e _ m o d u l e s \b ) / . test ( filepath ) && / \. ( c s s | j s ) $ / g. test ( filepath ) ) {
6363 / \. ( c s s ) $ / i. test ( filepath ) ? assetTypeCount . css ++ : assetTypeCount . internal ++ ;
6464 }
6565 } ) ;
You can’t perform that action at this time.
0 commit comments