Skip to content
This repository was archived by the owner on Feb 18, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions packages/react-scripts/config/webpack.config.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,12 @@ module.exports = {
},
],
},
// The raw-loader allows importing of text files so their content
// can be used in components like the CodePane.
{
test: [/\.txt$/, /\.md$/, /\.example$/],
use: 'raw-loader',
},
// "file" loader makes sure those assets get served by WebpackDevServer.
// When you `import` an asset, you get its (virtual) filename.
// In production, they would get copied to the `build` folder.
Expand Down
6 changes: 6 additions & 0 deletions packages/react-scripts/config/webpack.config.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,12 @@ module.exports = {
),
// Note: this won't work without `new ExtractTextPlugin()` in `plugins`.
},
// The raw-loader allows importing of text files so their content
// can be used in components like the CodePane.
{
test: [/\.txt$/, /\.md$/, /\.example$/],
use: 'raw-loader',
},
// "file" loader makes sure assets end up in the `build` folder.
// When you `import` an asset, you get its filename.
// This loader doesn't use a "test" so it will catch all modules
Expand Down
1 change: 1 addition & 0 deletions packages/react-scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"postcss-loader": "2.0.8",
"promise": "8.0.1",
"raf": "3.4.0",
"raw-loader": "^0.5.1",
"react-dev-utils": "^4.2.1",
"spectacle": "^4.0.0",
"style-loader": "0.19.0",
Expand Down