Skip to content

Commit

Permalink
Merge pull request #423 from iCHEF/build/webpack-v5-font-and-svg-loader
Browse files Browse the repository at this point in the history
build: fix svg and font loader config of webpack.dist.js
  • Loading branch information
kyoyadmoon authored Jan 3, 2024
2 parents 2112c8a + 422b543 commit d2ce155
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 20 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@
"@babel/preset-react": "^7.23.3",
"@babel/runtime": "^7.4.4",
"@babel/runtime-corejs3": "^7.4.4",
"@cfaester/enzyme-adapter-react-18": "^0.7.1",
"@testing-library/jest-dom": "^5.16.4",
"@testing-library/react": "^13.4.0",
"@testing-library/react-hooks": "^7.0.2",
"@testing-library/user-event": "^13.5.0",
"@cfaester/enzyme-adapter-react-18": "^0.7.1",
"autoprefixer": "^9.6.1",
"babel-core": "7.0.0-bridge.0",
"babel-eslint": "^10.0.1",
Expand All @@ -66,7 +66,6 @@
"eslint-plugin-react": "7.20",
"eslint-plugin-react-hooks": "4.1",
"eslint-plugin-unicorn": "21.0",
"file-loader": "^6.2.0",
"jest": "^26.1.0",
"lerna": "^3.22.1",
"mini-css-extract-plugin": "^2.7.6",
Expand Down
26 changes: 8 additions & 18 deletions packages/core/configs/webpack.dist.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,17 @@ module.exports = webpackMerge(defaultConfigs, {
include: [
path.resolve(packageDirname, 'src/fonts'),
],
use: [
{
loader: 'file-loader',
options: {
name: '[name]-[hash:6].[ext]',
outputPath: 'fonts/',
},
},
],
type: 'asset/resource',
generator: {
filename: 'fonts/[name]-[hash:6][ext]',
},
},
{
test: /\.svg$/,
use: [
{
loader: 'file-loader',
options: {
name: '[name]-[hash:6].[ext]',
outputPath: 'icons/',
},
},
],
type: 'asset/resource',
generator: {
filename: 'icons/[name]-[hash:6][ext]',
},
},
],
},
Expand Down

0 comments on commit d2ce155

Please sign in to comment.