Skip to content

Instantly share code, notes, and snippets.

@gabrielecanepa
Last active April 7, 2020 23:18
Show Gist options
  • Save gabrielecanepa/2d447837b0e1ace3d3c7403a06f15e9a to your computer and use it in GitHub Desktop.
Save gabrielecanepa/2d447837b0e1ace3d3c7403a06f15e9a to your computer and use it in GitHub Desktop.
Enable absolute imports in Gatsby
const path = require('path');
exports.onCreateWebpackConfig = ({ stage, actions }) => {
actions.setWebpackConfig({
resolve: {
modules: [path.resolve(__dirname, 'src'), 'node_modules'],
},
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment