diff --git a/packages/react-scripts/config/webpack.config.dev.js b/packages/react-scripts/config/webpack.config.dev.js index 7244ff79671..3d9a391d6d4 100644 --- a/packages/react-scripts/config/webpack.config.dev.js +++ b/packages/react-scripts/config/webpack.config.dev.js @@ -146,6 +146,7 @@ module.exports = { /\.gif$/, /\.jpe?g$/, /\.png$/, + /\.txt$/, ], loader: 'file-loader', options: { @@ -212,6 +213,10 @@ module.exports = { }, ], }, + { + test: /\.txt$/, + use: 'raw-loader', + }, // ** STOP ** Are you adding a new loader? // Remember to add the new extension(s) to the "url" loader exclusion list. ], diff --git a/packages/react-scripts/config/webpack.config.prod.js b/packages/react-scripts/config/webpack.config.prod.js index 01e9d6fe796..c4825b22512 100644 --- a/packages/react-scripts/config/webpack.config.prod.js +++ b/packages/react-scripts/config/webpack.config.prod.js @@ -146,6 +146,7 @@ module.exports = { /\.gif$/, /\.jpe?g$/, /\.png$/, + /\.txt$/, ], loader: 'file-loader', options: { @@ -222,6 +223,10 @@ module.exports = { ), // Note: this won't work without `new ExtractTextPlugin()` in `plugins`. }, + { + test: /\.txt$/, + use: 'raw-loader', + }, // ** STOP ** Are you adding a new loader? // Remember to add the new extension(s) to the "url" loader exclusion list. ], diff --git a/packages/react-scripts/package.json b/packages/react-scripts/package.json index 3e951ab9ad3..093053c523b 100644 --- a/packages/react-scripts/package.json +++ b/packages/react-scripts/package.json @@ -51,6 +51,7 @@ "object-assign": "4.1.1", "postcss-loader": "1.3.3", "promise": "7.1.1", + "raw-loader": "^0.5.1", "react-dev-utils": "^0.5.2", "style-loader": "0.16.0", "url-loader": "0.5.8",