Skip to content

Commit ef833f7

Browse files
A-gambitGeorge Czabania
authored and
George Czabania
committed
add otf font format to loaders (facebook#434)
* add off font format to loaders * add otf format support
1 parent 53bb28d commit ef833f7

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

config/eslint.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ module.exports = {
4545
settings: {
4646
'import/ignore': [
4747
'node_modules',
48-
'\\.(json|css|jpg|png|gif|eot|svg|ttf|woff|woff2|mp4|webm)$',
48+
'\\.(json|css|jpg|png|gif|eot|otf|svg|ttf|woff|woff2|mp4|webm)$',
4949
],
5050
'import/extensions': ['.js'],
5151
'import/resolver': {

config/webpack.config.dev.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ module.exports = {
127127
// When you `import` an asset, you get its (virtual) filename.
128128
// In production, they would get copied to the `build` folder.
129129
{
130-
test: /\.(ico|jpg|png|gif|eot|svg|ttf|woff|woff2)(\?.*)?$/,
130+
test: /\.(ico|jpg|png|gif|eot|otf|svg|ttf|woff|woff2)(\?.*)?$/,
131131
include: [paths.appSrc, paths.appNodeModules],
132132
exclude: /\/favicon.ico$/,
133133
loader: 'file',

config/webpack.config.prod.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ module.exports = {
137137
// "file" loader makes sure those assets end up in the `build` folder.
138138
// When you `import` an asset, you get its filename.
139139
{
140-
test: /\.(ico|jpg|png|gif|eot|svg|ttf|woff|woff2)(\?.*)?$/,
140+
test: /\.(ico|jpg|png|gif|eot|otf|svg|ttf|woff|woff2)(\?.*)?$/,
141141
exclude: /\/favicon.ico$/,
142142
include: [paths.appSrc, paths.appNodeModules],
143143
loader: 'file',

scripts/utils/createJestConfig.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ module.exports = (resolve, rootDir) => {
1111
const config = {
1212
automock: false,
1313
moduleNameMapper: {
14-
'^[./a-zA-Z0-9$_-]+\\.(jpg|png|gif|eot|svg|ttf|woff|woff2|mp4|webm)$': resolve('config/jest/FileStub.js'),
14+
'^[./a-zA-Z0-9$_-]+\\.(jpg|png|gif|eot|otf|svg|ttf|woff|woff2|mp4|webm)$': resolve('config/jest/FileStub.js'),
1515
'^[./a-zA-Z0-9$_-]+\\.css$': resolve('config/jest/CSSStub.js')
1616
},
1717
persistModuleRegistryBetweenSpecs: true,

template/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ esproposal.class_static_fields=enable
373373
esproposal.class_instance_fields=enable
374374

375375
module.name_mapper='^\(.*\)\.css$' -> 'react-scripts/config/flow/css'
376-
module.name_mapper='^\(.*\)\.\(jpg\|png\|gif\|eot\|svg\|ttf\|woff\|woff2\|mp4\|webm\)$' -> 'react-scripts/config/flow/file'
376+
module.name_mapper='^\(.*\)\.\(jpg\|png\|gif\|eot\|otf\|svg\|ttf\|woff\|woff2\|mp4\|webm\)$' -> 'react-scripts/config/flow/file'
377377

378378
suppress_type=$FlowIssue
379379
suppress_type=$FlowFixMe
@@ -385,7 +385,7 @@ If you later `eject`, you’ll need to replace `react-scripts` references with t
385385
386386
```ini
387387
module.name_mapper='^\(.*\)\.css$' -> '<PROJECT_ROOT>/config/flow/css'
388-
module.name_mapper='^\(.*\)\.\(jpg\|png\|gif\|eot\|svg\|ttf\|woff\|woff2\|mp4\|webm\)$' -> '<PROJECT_ROOT>/config/flow/file'
388+
module.name_mapper='^\(.*\)\.\(jpg\|png\|gif\|eot\|otf\|svg\|ttf\|woff\|woff2\|mp4\|webm\)$' -> '<PROJECT_ROOT>/config/flow/file'
389389
```
390390
391391
We will consider integrating more tightly with Flow in the future so that you don’t have to do this.

0 commit comments

Comments
 (0)