when webpack4.x is packaged in require b.js in a.js, what happens when css introduced in b.js is packaged into css introduced by a.js?
the following is the webpack.config.js configuration
Please give us your advice
const path = require("path");
const htmlWebpackPlugin = require("html-webpack-plugin");
const cleanWebpackPlugin = require("clean-webpack-plugin");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");//css
const ExtractTextPlugin = require("extract-text-webpack-plugin");
var getHtmlConfig = function (filename,title) {
return {
template:"./src/" + filename + "/"+ filename + ".html",
filename: filename + ".html",
title:title,
hash:true,
chunks:[filename]
}
}
module.exports = {
entry: {
index:"./src/index/index.js",
test:"./src/test/test.js"
},
output: {
filename: "./js/[name].bundle.js",
path: path.resolve(__dirname,"dist"),
},
devServer:{
contentBase: "./dist"
},
plugins: [
new htmlWebpackPlugin(getHtmlConfig("index","index")),
new htmlWebpackPlugin(getHtmlConfig("test","test")),
new cleanWebpackPlugin(["dist"])
],
module:{
rules:[
{
test:/\.css$/,
use:ExtractTextPlugin.extract({
fallback: "style-loader",
use: "css-loader"
})
},
{
test:/\.(png|svg|jpg|gif)$/,
use:[
"file-loader"
]
},
{
test: /\.(woff|woff2|eot|ttf|otf)$/,
use:[
"file-loader"
]
}
]
}