Created
May 11, 2018 20:52
-
-
Save yutahaga/1a7f37491a6177d3a924fb2d024de905 to your computer and use it in GitHub Desktop.
TypeScipt + @storybook/vue + @vue/cli 構成用の Webpack 設定ファイル。@vue/cli@3.0.0-beta.10 + webpack@4.8.2 + vue-loader@15.0.10 でビルド確認済み。
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 merge = require('webpack-merge'); | |
const vueConfig = require('@vue/cli-service/webpack.config.js'); | |
module.exports = (storybookConfig, configType) => { | |
return { | |
...vueConfig, // use vue's webpack configuration by default | |
entry: storybookConfig.entry, // overwite entry | |
output: storybookConfig.output, // overwrite output | |
// remove duplicated plugins | |
plugins: merge({ | |
customizeArray: merge.unique( | |
'plugins', | |
['HotModuleReplacementPlugin', 'CaseSensitivePathsPlugin', 'WatchMissingNodeModulesPlugin'], | |
plugin => plugin.constructor && plugin.constructor.name, | |
), | |
})(vueConfig, storybookConfig).plugins, | |
resolve: { | |
// <--------- This bit here | |
...vueConfig.resolve, | |
alias: { | |
...vueConfig.resolve.alias, | |
vue$: storybookConfig.resolve.alias.vue$, | |
}, | |
}, | |
}; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
参考:almeynman/typescript-vue-storybook-tutorial