Closed
Description
I don't think the browser needs to make extra an request to fetch the css file of its own async js chunk which it has been loaded. So I want to disable.
It should be something like the "fallback" option of extract-text-webpack-plugin
and its behavior. However, I'm not able to find an equivalent way with mini-css-extract-plugin
and webpack 4.
For example, let's say we have several pages will be loaded on demand:
// routes.js inside intial-chunk.js
import './initial-chunk.css';
const routes: [
{
module: () => import('pageA')
}
];
// pageA.js
import './pageA.css';
export default {
// something that pageA should do
};
// pageB.js
import './pageB.css';
export default {
// something that pageB should do
};
And the output files should be like this:
vendor.js
initial-chunk.js
initial-chunk.css
pageA.js
pageB.js
// Note that there isn't a "pageA.css" or "pageB.css" file. These css files are inside their own chunks and loaded by some other loaders, `style-loader` for example
How can I achieve this? Thank you very much.
Metadata
Metadata
Assignees
Labels
No labels