Skip to content

Commit ae20a78

Browse files
authored
Merge pull request #182 from BeAPI/fix/webpack-assets
Fix/webpack assets
2 parents 8b61024 + 76b75a7 commit ae20a78

File tree

5 files changed

+5
-24
lines changed

5 files changed

+5
-24
lines changed

config/loaders.js

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -58,25 +58,14 @@ const SCSSLoaderProd = {
5858
}
5959

6060
const FontsLoader = {
61-
test: /\.(woff2?|woff|eot|ttf|otf|mp3|wav)(\?.*)?$/,
62-
use: {
63-
loader: 'file-loader',
64-
options: {
65-
name: '[name].[ext]',
66-
outputPath: './fonts/',
67-
},
68-
},
61+
test: /\.(woff|woff2)$/,
62+
type: 'asset/resource',
6963
}
7064

7165
const ImagesLoader = {
7266
test: /\.(png|jpe?g|gif)$/,
67+
type: 'asset/resource',
7368
use: [
74-
{
75-
loader: 'file-loader',
76-
options: {
77-
name: '[path][name].[ext]',
78-
},
79-
},
8069
{
8170
loader: 'image-webpack-loader',
8271
options: {

config/webpack.common.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ module.exports = {
99
filename: '[name].js',
1010
path: path.resolve(__dirname, '../dist'),
1111
publicPath: '',
12+
assetModuleFilename: 'assets/[hash][ext][query]',
1213
},
1314
module: {
1415
rules: [loaders.FontsLoader, loaders.ImagesLoader, loaders.JSLoader],

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
"esbuild-loader": "^2.13.1",
2020
"eslint": "^7.24.0",
2121
"eslint-webpack-plugin": "^2.5.4",
22-
"file-loader": "^6.2.0",
2322
"image-webpack-loader": "^7.0.1",
2423
"lazysizes": "^5.3.2",
2524
"mini-css-extract-plugin": "^1.5.0",

src/scss/abstract/_variables.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ $base-border-radius: 3px;
9494
// Font Family
9595
// ----
9696
$primary-font-family: roboto, sans-serif;
97-
$secondary-font-family: sofia-pro, sans-serif;
97+
$secondary-font-family: roboto, sans-serif;
9898

9999
// ----
100100
// Font Size

yarn.lock

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2570,14 +2570,6 @@ file-entry-cache@^6.0.1:
25702570
dependencies:
25712571
flat-cache "^3.0.4"
25722572

2573-
file-loader@^6.2.0:
2574-
version "6.2.0"
2575-
resolved "https://registry.yarnpkg.com/file-loader/-/file-loader-6.2.0.tgz#baef7cf8e1840df325e4390b4484879480eebe4d"
2576-
integrity sha512-qo3glqyTa61Ytg4u73GultjHGjdRyig3tG6lPtyX/jOEJvHif9uB0/OCI2Kif6ctF3caQTW2G5gym21oAsI4pw==
2577-
dependencies:
2578-
loader-utils "^2.0.0"
2579-
schema-utils "^3.0.0"
2580-
25812573
file-type@5.2.0, file-type@^5.2.0:
25822574
version "5.2.0"
25832575
resolved "https://registry.yarnpkg.com/file-type/-/file-type-5.2.0.tgz#2ddbea7c73ffe36368dfae49dc338c058c2b8ad6"

0 commit comments

Comments
 (0)