mirror of
https://github.com/photoprism/photoprism.git
synced 2025-12-12 00:34:13 +01:00
UX: Reduce JS bundle size by loading translation files on demand #4778
Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
@@ -46,7 +46,6 @@ const PATHS = {
|
||||
share: path.join(__dirname, "src/share.js"),
|
||||
splash: path.join(__dirname, "src/splash.js"),
|
||||
build: path.join(__dirname, "../assets/static/build"),
|
||||
public: "./",
|
||||
};
|
||||
|
||||
if (isCustom) {
|
||||
@@ -72,8 +71,10 @@ const config = {
|
||||
},
|
||||
output: {
|
||||
path: PATHS.build,
|
||||
publicPath: PATHS.public,
|
||||
publicPath: "auto",
|
||||
filename: "[name].[contenthash].js",
|
||||
chunkFilename: "chunk/[name].[contenthash].js",
|
||||
asyncChunks: true,
|
||||
clean: true,
|
||||
},
|
||||
resolve: {
|
||||
@@ -147,6 +148,11 @@ const config = {
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
test: /\.json$/,
|
||||
include: PATHS.src,
|
||||
type: "json",
|
||||
},
|
||||
{
|
||||
test: /\.css$/,
|
||||
include: isCustom ? [PATHS.custom, PATHS.css] : [PATHS.css],
|
||||
@@ -154,9 +160,6 @@ const config = {
|
||||
use: [
|
||||
{
|
||||
loader: MiniCssExtractPlugin.loader,
|
||||
options: {
|
||||
publicPath: PATHS.public,
|
||||
},
|
||||
},
|
||||
{
|
||||
loader: "css-loader",
|
||||
@@ -183,9 +186,6 @@ const config = {
|
||||
use: [
|
||||
{
|
||||
loader: MiniCssExtractPlugin.loader,
|
||||
options: {
|
||||
publicPath: PATHS.public,
|
||||
},
|
||||
},
|
||||
{
|
||||
loader: "css-loader",
|
||||
@@ -211,9 +211,6 @@ const config = {
|
||||
use: [
|
||||
{
|
||||
loader: MiniCssExtractPlugin.loader,
|
||||
options: {
|
||||
publicPath: PATHS.public,
|
||||
},
|
||||
},
|
||||
{
|
||||
loader: "css-loader",
|
||||
|
||||
Reference in New Issue
Block a user