Last active
October 11, 2019 18:26
-
-
Save whoisryosuke/21c7bc238d5f020732d622cb3018890d to your computer and use it in GitHub Desktop.
Storybook / Webpack - How to add relative aliasing (@component/Button vs '../../component/Button`)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const path = require('path') | |
module.exports = ({ config, mode }) => { | |
// Adds absolute paths to imports | |
config.resolve.alias = { | |
...config.resolve.alias, | |
'@components': path.resolve(__dirname, '../src/components'), | |
'@assets': path.resolve(__dirname, '../src/assets'), | |
'@helpers': path.resolve(__dirname, '../src/helpers'), | |
'@layouts': path.resolve(__dirname, '../src/layouts'), | |
'@templates': path.resolve(__dirname, '../src/templates'), | |
} | |
return config | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment