File tree 2 files changed +6
-2
lines changed
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:
41
41
42
42
## Installation
43
43
``` bash
44
+ // For Webpack v3.x
44
45
npm 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
45
49
```
46
50
## Usage
47
51
Original file line number Diff line number Diff line change @@ -54,12 +54,12 @@ OmitJSforCSSPlugin.prototype.findOmissibleFiles = function(compilation) {
54
54
} ) ;
55
55
56
56
// 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 => {
58
58
if ( ! Array . isArray ( module . fileDependencies ) ) {
59
59
return ;
60
60
}
61
61
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 ) ) {
63
63
/ \. ( c s s ) $ / i. test ( filepath ) ? assetTypeCount . css ++ : assetTypeCount . internal ++ ;
64
64
}
65
65
} ) ;
You can’t perform that action at this time.
0 commit comments