Skip to content

Commit

Permalink
fix: fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ValeraS committed Dec 9, 2024
1 parent 91a5665 commit ef12696
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions src/common/webpack/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,12 @@ function getCssLoaders(
loaders.unshift({
loader: require.resolve('css-loader'),
options: {
url: {
filter: (url: string) => {
// ignore data uri
return !url.startsWith('data:');
},
},
sourceMap: !config.disableSourceMapGeneration,
importLoaders,
modules: {
Expand Down Expand Up @@ -535,7 +541,7 @@ function createIconsRule(
generator: {
filename: 'assets/images/[name].[contenthash:8][ext]',
publicPath: isEnvProduction ? '../' : undefined,
emit: isSsr ? false : undefined,
emit: !isSsr,
},
}),
};
Expand All @@ -553,7 +559,7 @@ function createAssetsRules({isEnvProduction, config, isSsr}: HelperOptions): web
},
generator: {
filename: 'assets/images/[name].[contenthash:8][ext]',
emit: isSsr ? false : undefined,
emit: !isSsr,
},
};
const fontsRule = {
Expand All @@ -567,7 +573,7 @@ function createAssetsRules({isEnvProduction, config, isSsr}: HelperOptions): web
},
generator: {
filename: 'assets/fonts/[name].[contenthash:8][ext]',
emit: isSsr ? false : undefined,
emit: !isSsr,
},
};

Expand All @@ -590,7 +596,7 @@ function createAssetsRules({isEnvProduction, config, isSsr}: HelperOptions): web
generator: {
filename: 'assets/images/[name].[contenthash:8][ext]',
publicPath: '../',
emit: isSsr ? false : undefined,
emit: !isSsr,
},
},
{
Expand All @@ -606,7 +612,7 @@ function createAssetsRules({isEnvProduction, config, isSsr}: HelperOptions): web
generator: {
filename: 'assets/fonts/[name].[contenthash:8][ext]',
publicPath: '../',
emit: isSsr ? false : undefined,
emit: !isSsr,
},
},
);
Expand All @@ -621,7 +627,7 @@ function createFallbackRules({isEnvProduction, isSsr}: HelperOptions) {
type: 'asset/resource',
generator: {
filename: 'assets/[name].[contenthash:8][ext]',
emit: isSsr ? false : undefined,
emit: !isSsr,
},
exclude: [/\.[jt]sx?$/, /\.json$/, /\.[cm]js$/, /\.ejs$/],
},
Expand All @@ -637,7 +643,7 @@ function createFallbackRules({isEnvProduction, isSsr}: HelperOptions) {
generator: {
filename: 'assets/[name].[contenthash:8][ext]',
publicPath: '../',
emit: isSsr ? false : undefined,
emit: !isSsr,
},
});
}
Expand Down

0 comments on commit ef12696

Please sign in to comment.