Skip to content

Commit

Permalink
Merge pull request #12983 from Expensify/Rory-PreloadFonts
Browse files Browse the repository at this point in the history
Preload web fonts
  • Loading branch information
Luke9389 authored Feb 6, 2023
2 parents 37e9344 + 262b380 commit 26fdace
Show file tree
Hide file tree
Showing 4 changed files with 856 additions and 41 deletions.
18 changes: 8 additions & 10 deletions config/webpack/webpack.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const CopyPlugin = require('copy-webpack-plugin');
const dotenv = require('dotenv');
const {BundleAnalyzerPlugin} = require('webpack-bundle-analyzer');
const HtmlInlineScriptPlugin = require('html-inline-script-webpack-plugin');
const FontPreloadPlugin = require('webpack-font-preload-plugin');
const CustomVersionFilePlugin = require('./CustomVersionFilePlugin');

const includeModules = [
Expand Down Expand Up @@ -79,6 +80,9 @@ const webpackConfig = ({envFile = '.env', platform = 'web'}) => ({
new HtmlInlineScriptPlugin({
scriptMatchPattern: [/splash.+[.]js$/],
}),
new FontPreloadPlugin({
extensions: ['woff2'],
}),
new ProvidePlugin({
process: 'process/browser',
}),
Expand Down Expand Up @@ -152,22 +156,16 @@ const webpackConfig = ({envFile = '.env', platform = 'web'}) => ({
// Rule for react-native-web-webview
{
test: /postMock.html$/,
use: {
loader: 'file-loader',
options: {
name: '[name].[ext]',
},
type: 'asset',
generator: {
filename: '[name].[ext]',
},
},

// Gives the ability to load local images
{
test: /\.(png|jpe?g|gif)$/i,
use: [
{
loader: 'file-loader',
},
],
type: 'asset',
},

// Load svg images
Expand Down
Loading

0 comments on commit 26fdace

Please sign in to comment.