### Install
npm install gatsby-remark-import-code``bash`
$ npm install gatsby-remark-import-code
Use it together with gatsby-plugin-mdx. In gatsby-config.js:
`jsgatsby-plugin-mdx
module.exports = {
plugins: [
{
resolve: ,gatsby-remark-import-code
options: {
gatsbyRemarkPlugins: []`
}
}
]
};
It transforms md/mdx code blocks from this:
``md`js file=./hello-world.js```
into:
``md`js`
function helloWorld() {
return "hello world";
}```