Created
November 12, 2019 13:04
-
-
Save dazulu/3ad710364493bac902c8e64d30ef8f05 to your computer and use it in GitHub Desktop.
A webpack config for Storybook against Nuxt (vue, typescript)
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') | |
const rootPath = path.resolve(__dirname, '../') | |
module.exports = ({ config }) => { | |
config.module.rules.push( | |
{ | |
test: /\.(ts|tsx)$/, | |
use: [ | |
{ | |
loader: 'babel-loader' | |
}, | |
{ | |
loader: require.resolve('ts-loader'), | |
options: { | |
appendTsSuffixTo: [/\.vue$/], | |
transpileOnly: true | |
} | |
} | |
] | |
}, | |
{ | |
test: /\.scss$/, | |
use: [ | |
'vue-style-loader', | |
'css-loader', | |
{ | |
loader: 'sass-loader', | |
options: { | |
data: ` | |
@import '@/css/default/_variables.scss'; | |
@import '@/assets/css/fonts.scss'; | |
@import '@/assets/css/modern-reset.scss'; | |
@import '@/assets/css/typography.scss'; | |
` | |
} | |
} | |
] | |
}, | |
{ | |
test: /\.vue$/, | |
loader: 'storybook-addon-vue-info/loader', | |
enforce: 'post' | |
} | |
) | |
config.resolve.extensions.push('.ts', '.tsx', '.js') | |
config.resolve.alias['@'] = rootPath | |
return config | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment