feat: support re-export story from vue

This commit is contained in:
Herrington Darkholme
2020-07-25 17:26:21 +08:00
committed by jeremywu
parent fcba294463
commit cb0b012fac
3 changed files with 22 additions and 3 deletions

View File

@@ -13,6 +13,20 @@ function webpack(config) {
loader: require.resolve('vue-loader'),
options: {},
},
{
test: /\.stories\.ts$/,
use: [
{
loader: require.resolve('./export-loader')
},
{
loader: require.resolve('ts-loader'),
options: {
transpileOnly: true,
},
},
]
},
{
test: /\.(ts|tsx)$/,
use: [

View File

@@ -0,0 +1,7 @@
module.exports = function (content) {
return content.replace(
/export ?{\s* default as (.+?)}(.+)/g,`
import _$1 $2
export const $1 = () => _$1
`)
}

View File

@@ -1,7 +1,5 @@
import Basic from './basic.vue'
export { default as BasicUsage} from './basic.vue'
export default {
title: "Badge",
}
export const BasicUsage = () => Basic