-
Notifications
You must be signed in to change notification settings - Fork 47
Closed
Description
Please forgive me if this was already reported, however, I believe my situation to be different.
WARNING in webpack-subresource-integrity: Cannot determine asset for chunk 24, computed="style.js", available=style.css. Please report this full error message along...
This happens because I am extracting CSS styles from style.js using mini-css-extract-plugin and removing the now empty style.js file using webpack-fix-style-only-entries. Here is a sample Webpack configuration demonstrating the issue.
const path = require('path');
const FixStyle = require('webpack-fix-style-only-entries');
const Extract = require('mini-css-extract-plugin');
const HTML = require('html-webpack-plugin');
const SRI = require('webpack-subresource-integrity');
module.exports =
{
mode: 'production',
context: path.join(process.cwd(), 'source/'),
entry:
{
style: [ 'styles/style' ],
entry: [ 'scripts/entry' ]
},
output:
{
crossOriginLoading: 'anonymous',
chunkFilename: '[name]-[chunkhash].js',
filename: '[name]-[contenthash].js',
path: path.resolve(__dirname, 'public')
},
plugins:
[
new FixStyle(),
new Extract({ filename: '[name]-[contenthash].css' }),
new HTML
({
filename: 'index.html',
template: 'index.ejs'
}),
new SRI({ hashFuncNames: [ 'sha384' ] })
],
module:
{
rules:
[
{
test: /\.css$/,
use: [ Extract.loader, 'css-loader' ]
}
]
}
};I am using webpack-subresource-integrity@1.3.2
Metadata
Metadata
Assignees
Labels
No labels