Skip to content

Commit a32afd3

Browse files
A-gambitfeiqitian
authored andcommitted
add otf font format to loaders (facebook#434)
* add off font format to loaders * add otf format support
1 parent 598cdb3 commit a32afd3

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
@@ -126,7 +126,7 @@ module.exports = {
126126
// When you `import` an asset, you get its (virtual) filename.
127127
// In production, they would get copied to the `build` folder.
128128
{
129-
test: /\.(ico|jpg|png|gif|eot|svg|ttf|woff|woff2)(\?.*)?$/,
129+
test: /\.(ico|jpg|png|gif|eot|otf|svg|ttf|woff|woff2)(\?.*)?$/,
130130
include: [paths.appSrc, paths.appNodeModules],
131131
exclude: /\/favicon.ico$/,
132132
loader: 'file',

config/webpack.config.prod.js

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