diff --git a/packages/login/webpack/webpack.base.js b/packages/login/webpack/webpack.base.js index 0b7616341f..c9aea58639 100644 --- a/packages/login/webpack/webpack.base.js +++ b/packages/login/webpack/webpack.base.js @@ -55,6 +55,29 @@ module.exports = { type: "asset/resource", 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$/, issuer: /\.[jt]sx?$/, diff --git a/packages/login/webpack/webpack.client.js b/packages/login/webpack/webpack.client.js index d31eb133c0..89ab5995e8 100644 --- a/packages/login/webpack/webpack.client.js +++ b/packages/login/webpack/webpack.client.js @@ -100,15 +100,15 @@ const clientConfig = { shared: { ...sharedDeps, ...deps }, }), new ExternalTemplateRemotesPlugin(), - new CopyPlugin({ - patterns: [ - { - context: path.resolve(__dirname, "../public"), - from: "locales/**/*.json", - transform: minifyJson, - }, - ], - }), + // new CopyPlugin({ + // patterns: [ + // { + // context: path.resolve(__dirname, "../public"), + // from: "locales/**/*.json", + // transform: minifyJson, + // }, + // ], + // }), new WebpackManifestPlugin(), ], };