Web:Login: update webpack config for work with json files as url
This commit is contained in:
parent
2002564c1a
commit
17a1ab2152
@ -55,6 +55,29 @@ module.exports = {
|
|||||||
type: "asset/resource",
|
type: "asset/resource",
|
||||||
resourceQuery: /url/, // *.svg?url
|
resourceQuery: /url/, // *.svg?url
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
test: /\.json$/i,
|
||||||
|
resourceQuery: /url/,
|
||||||
|
type: "javascript/auto",
|
||||||
|
use: [
|
||||||
|
{
|
||||||
|
loader: "file-loader",
|
||||||
|
options: {
|
||||||
|
name: (resourcePath, resourceQuery) => {
|
||||||
|
let result = resourcePath.split("public\\")[1].split("\\");
|
||||||
|
|
||||||
|
result.pop();
|
||||||
|
|
||||||
|
let folder = result.join("/");
|
||||||
|
|
||||||
|
folder += result.length === 0 ? "" : "/";
|
||||||
|
|
||||||
|
return `${folder}[name].[ext]?hash=[contenthash]`; // `${folder}/[name].[contenthash][ext]`;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
{
|
{
|
||||||
test: /\.react.svg$/,
|
test: /\.react.svg$/,
|
||||||
issuer: /\.[jt]sx?$/,
|
issuer: /\.[jt]sx?$/,
|
||||||
|
@ -100,15 +100,15 @@ const clientConfig = {
|
|||||||
shared: { ...sharedDeps, ...deps },
|
shared: { ...sharedDeps, ...deps },
|
||||||
}),
|
}),
|
||||||
new ExternalTemplateRemotesPlugin(),
|
new ExternalTemplateRemotesPlugin(),
|
||||||
new CopyPlugin({
|
// new CopyPlugin({
|
||||||
patterns: [
|
// patterns: [
|
||||||
{
|
// {
|
||||||
context: path.resolve(__dirname, "../public"),
|
// context: path.resolve(__dirname, "../public"),
|
||||||
from: "locales/**/*.json",
|
// from: "locales/**/*.json",
|
||||||
transform: minifyJson,
|
// transform: minifyJson,
|
||||||
},
|
// },
|
||||||
],
|
// ],
|
||||||
}),
|
// }),
|
||||||
new WebpackManifestPlugin(),
|
new WebpackManifestPlugin(),
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user