From 66d47566b0bad66cdac7077de2ae8116f439a948 Mon Sep 17 00:00:00 2001 From: Gregory Shehet Date: Sat, 13 Aug 2016 17:15:05 +0300 Subject: [PATCH 1/2] add off font format to loaders --- config/webpack.config.dev.js | 2 +- config/webpack.config.prod.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/webpack.config.dev.js b/config/webpack.config.dev.js index 5e28bb7c916..cf7f75aef9e 100644 --- a/config/webpack.config.dev.js +++ b/config/webpack.config.dev.js @@ -126,7 +126,7 @@ module.exports = { // When you `import` an asset, you get its (virtual) filename. // In production, they would get copied to the `build` folder. { - test: /\.(ico|jpg|png|gif|eot|svg|ttf|woff|woff2)(\?.*)?$/, + test: /\.(ico|jpg|png|gif|eot|otf|svg|ttf|woff|woff2)(\?.*)?$/, include: [paths.appSrc, paths.appNodeModules], exclude: /\/favicon.ico$/, loader: 'file', diff --git a/config/webpack.config.prod.js b/config/webpack.config.prod.js index ffeb75a9488..5781ae8636b 100644 --- a/config/webpack.config.prod.js +++ b/config/webpack.config.prod.js @@ -136,7 +136,7 @@ module.exports = { // "file" loader makes sure those assets end up in the `build` folder. // When you `import` an asset, you get its filename. { - test: /\.(ico|jpg|png|gif|eot|svg|ttf|woff|woff2)(\?.*)?$/, + test: /\.(ico|jpg|png|gif|eot|otf|svg|ttf|woff|woff2)(\?.*)?$/, exclude: /\/favicon.ico$/, include: [paths.appSrc, paths.appNodeModules], loader: 'file', From 9de1e1d606173ac105831d453cb7d5ebc656dc80 Mon Sep 17 00:00:00 2001 From: Gregory Shehet Date: Thu, 18 Aug 2016 17:25:53 +0300 Subject: [PATCH 2/2] add otf format support --- config/eslint.js | 2 +- scripts/utils/createJestConfig.js | 2 +- template/README.md | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config/eslint.js b/config/eslint.js index 513ad2de02f..761add0f718 100644 --- a/config/eslint.js +++ b/config/eslint.js @@ -45,7 +45,7 @@ module.exports = { settings: { 'import/ignore': [ 'node_modules', - '\\.(json|css|jpg|png|gif|eot|svg|ttf|woff|woff2|mp4|webm)$', + '\\.(json|css|jpg|png|gif|eot|otf|svg|ttf|woff|woff2|mp4|webm)$', ], 'import/extensions': ['.js'], 'import/resolver': { diff --git a/scripts/utils/createJestConfig.js b/scripts/utils/createJestConfig.js index 3072074807e..a420e6fd6bc 100644 --- a/scripts/utils/createJestConfig.js +++ b/scripts/utils/createJestConfig.js @@ -11,7 +11,7 @@ module.exports = (resolve, rootDir) => { const config = { automock: false, moduleNameMapper: { - '^[./a-zA-Z0-9$_-]+\\.(jpg|png|gif|eot|svg|ttf|woff|woff2|mp4|webm)$': resolve('config/jest/FileStub.js'), + '^[./a-zA-Z0-9$_-]+\\.(jpg|png|gif|eot|otf|svg|ttf|woff|woff2|mp4|webm)$': resolve('config/jest/FileStub.js'), '^[./a-zA-Z0-9$_-]+\\.css$': resolve('config/jest/CSSStub.js') }, persistModuleRegistryBetweenSpecs: true, diff --git a/template/README.md b/template/README.md index 6245d730885..821b0b68a67 100644 --- a/template/README.md +++ b/template/README.md @@ -373,7 +373,7 @@ esproposal.class_static_fields=enable esproposal.class_instance_fields=enable module.name_mapper='^\(.*\)\.css$' -> 'react-scripts/config/flow/css' -module.name_mapper='^\(.*\)\.\(jpg\|png\|gif\|eot\|svg\|ttf\|woff\|woff2\|mp4\|webm\)$' -> 'react-scripts/config/flow/file' +module.name_mapper='^\(.*\)\.\(jpg\|png\|gif\|eot\|otf\|svg\|ttf\|woff\|woff2\|mp4\|webm\)$' -> 'react-scripts/config/flow/file' suppress_type=$FlowIssue suppress_type=$FlowFixMe @@ -385,7 +385,7 @@ If you later `eject`, you’ll need to replace `react-scripts` references with t ```ini module.name_mapper='^\(.*\)\.css$' -> '/config/flow/css' -module.name_mapper='^\(.*\)\.\(jpg\|png\|gif\|eot\|svg\|ttf\|woff\|woff2\|mp4\|webm\)$' -> '/config/flow/file' +module.name_mapper='^\(.*\)\.\(jpg\|png\|gif\|eot\|otf\|svg\|ttf\|woff\|woff2\|mp4\|webm\)$' -> '/config/flow/file' ``` We will consider integrating more tightly with Flow in the future so that you don’t have to do this.