Skip to content

Commit

Permalink
fix webpack config for images url()s
Browse files Browse the repository at this point in the history
  • Loading branch information
goranalkovic-infinum committed Oct 3, 2024
1 parent d664cee commit d5aa98d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 23 deletions.
Binary file added bun.lockb
Binary file not shown.
32 changes: 9 additions & 23 deletions webpack/base.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -78,29 +78,6 @@ export default (options) => {
});
}

// Module for Images.
if (!options.overrides.includes('images')) {
module.rules.push({
test: /\.(png|svg|jpg|jpeg|gif|ico|webp)$/i,
use: [
{
loader: 'url-loader',
options: {
limit: 8192,
},
},
],
type: 'javascript/auto',
});

module.rules.push({
test: /\.(png|svg|jpg|jpeg|gif|ico|webp)$/i,
exclude: [/fonts/, /node_modules/],
use: 'file-loader?name=[name].[ext]',
dependency: { not: ['url'] },
});
}

// Module for CSS.
if (!options.overrides.includes('css')) {
module.rules.push({
Expand Down Expand Up @@ -128,6 +105,15 @@ export default (options) => {
});
}

// Module for Images.
if (!options.overrides.includes('images')) {
module.rules.push({
test: /\.(png|svg|jpg|jpeg|gif|ico|webp)$/i,
exclude: [/fonts/, /node_modules/],
type: 'asset/resource',
});
}

const resolve = {
symlinks: false,
};
Expand Down

0 comments on commit d5aa98d

Please sign in to comment.