Web:Login: add new webpack rules for assets
This commit is contained in:
parent
08fb97d7fd
commit
205fc24365
@ -39,8 +39,19 @@ module.exports = {
|
|||||||
test: fontsExtension,
|
test: fontsExtension,
|
||||||
type: "asset",
|
type: "asset",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
test: /\.(png|jpe?g|gif|ico)$/i,
|
||||||
|
type: "asset/resource",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
test: /\.svg$/i,
|
||||||
|
type: "asset/resource",
|
||||||
|
resourceQuery: /url/, // *.svg?url
|
||||||
|
},
|
||||||
{
|
{
|
||||||
test: /\.react.svg$/,
|
test: /\.react.svg$/,
|
||||||
|
issuer: /\.[jt]sx?$/,
|
||||||
|
resourceQuery: { not: [/url/] }, // exclude react component if *.svg?url
|
||||||
use: [
|
use: [
|
||||||
{
|
{
|
||||||
loader: "@svgr/webpack",
|
loader: "@svgr/webpack",
|
||||||
|
@ -30,6 +30,20 @@ const clientConfig = {
|
|||||||
filename: "static/js/[name].[contenthash].bundle.js",
|
filename: "static/js/[name].[contenthash].bundle.js",
|
||||||
publicPath: "/login/",
|
publicPath: "/login/",
|
||||||
chunkFilename: "static/js/[id].[contenthash].js",
|
chunkFilename: "static/js/[id].[contenthash].js",
|
||||||
|
assetModuleFilename: (pathData) => {
|
||||||
|
//console.log({ pathData });
|
||||||
|
|
||||||
|
let result = pathData.filename
|
||||||
|
.substr(pathData.filename.indexOf("public/"))
|
||||||
|
.split("/")
|
||||||
|
.slice(1);
|
||||||
|
|
||||||
|
result.pop();
|
||||||
|
|
||||||
|
let folder = result.join("/");
|
||||||
|
|
||||||
|
return `${folder}/[name].[contenthash][ext]`; //`${folder}/[name][ext]?hash=[contenthash]`;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
performance: {
|
performance: {
|
||||||
|
Loading…
Reference in New Issue
Block a user