-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ignore assets removed by other plugins
Also, make an effort to ensure our chunkAsset callback runs after callbacks registered by other plugins. Closes #106
- Loading branch information
Showing
7 changed files
with
78 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# With webpack-fix-style-only-entries | ||
|
||
Test case for issue #106 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
console.log('ok'); |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
var expect = require('expect'); | ||
var fs = require('fs'); | ||
var path = require('path'); | ||
|
||
var webpackVersion = Number(require('webpack/package.json').version.split('.')[0]); | ||
|
||
module.exports.skip = function skip() { | ||
return webpackVersion < 4; | ||
}; | ||
|
||
module.exports.check = function check(stats) { | ||
expect(stats.compilation.warnings.length).toEqual(0); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
var SriPlugin = require('webpack-subresource-integrity'); | ||
var MiniCssExtractPlugin = require('mini-css-extract-plugin'); | ||
var WebpackAssetsManifest = require('webpack-assets-manifest'); | ||
var FixStyleOnlyEntriesPlugin = require('webpack-fix-style-only-entries'); | ||
|
||
module.exports = { | ||
entry: { | ||
index: './index.js', | ||
style: ["./style.css"], | ||
}, | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.css$/, | ||
use: [ | ||
MiniCssExtractPlugin.loader, | ||
{ | ||
loader: 'css-loader', | ||
options: { | ||
importLoaders: 1 | ||
} | ||
} | ||
] | ||
}, | ||
], | ||
}, | ||
output: { | ||
crossOriginLoading: 'anonymous' | ||
}, | ||
plugins: [ | ||
new FixStyleOnlyEntriesPlugin({ | ||
silent: true | ||
}), | ||
new MiniCssExtractPlugin({ | ||
filename: "[name].css", | ||
}), | ||
new WebpackAssetsManifest({integrity: true}), | ||
new SriPlugin({ | ||
hashFuncNames: ['sha256', 'sha384'], | ||
enabled: true | ||
}), | ||
] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters