Skip to content

Load markdown files through markdown-with-front-matter-loader #1304

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
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
9 changes: 8 additions & 1 deletion packages/react-scripts/config/webpack.config.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ module.exports = {
/\.(js|jsx)$/,
/\.css$/,
/\.json$/,
/\.svg$/
/\.svg$/,
/\.md$/
],
loader: 'url-loader',
options: {
Expand Down Expand Up @@ -201,6 +202,12 @@ module.exports = {
options: {
name: 'static/media/[name].[hash:8].[ext]'
}
},
// Load Markdown files by converting them to JSON. It's then up to
// the consumer to render the result
{
test: /\.md$/,
loader: 'markdown-with-front-matter-loader'
}
// ** STOP ** Are you adding a new loader?
// Remember to add the new extension(s) to the "url" loader exclusion list.
Expand Down
9 changes: 8 additions & 1 deletion packages/react-scripts/config/webpack.config.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ module.exports = {
/\.(js|jsx)$/,
/\.css$/,
/\.json$/,
/\.svg$/
/\.svg$/,
/\.md$/
],
loader: 'url-loader',
options: {
Expand Down Expand Up @@ -215,6 +216,12 @@ module.exports = {
options: {
name: 'static/media/[name].[hash:8].[ext]'
}
},
// Load Markdown files by converting them to JSON. It's then up to
// the consumer to render the result
{
test: /\.md$/,
loader: 'markdown-with-front-matter-loader'
}
// ** STOP ** Are you adding a new loader?
// Remember to add the new extension(s) to the "url" loader exclusion list.
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 @@ -52,6 +52,7 @@
"html-webpack-plugin": "2.28.0",
"http-proxy-middleware": "0.17.3",
"jest": "18.1.0",
"markdown-with-front-matter-loader": "^0.1.0",
"object-assign": "4.1.1",
"postcss-loader": "1.2.2",
"promise": "7.1.1",
Expand Down