Skip to content

Commit

Permalink
Merge pull request #23377 from storybookjs/chaks/strict-ts-preset-vue…
Browse files Browse the repository at this point in the history
…3-webpack5

Build: Migrate  `preset-vue3-webpack` to ts strict mode
  • Loading branch information
kasperpeulen committed Jul 26, 2023
2 parents bf9b17f + 06d940b commit e329ab1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions code/presets/vue3-webpack/src/framework-preset-vue3-docs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ export const webpackFinal: StorybookConfig['webpackFinal'] = (config, options) =
}
});

config.module.rules.push({
config.module?.rules?.push({
test: /\.vue$/,
loader: require.resolve('vue-docgen-loader', {
paths: [require.resolve('@storybook/preset-vue3-webpack')],
}),
enforce: 'post',
options: {
docgenOptions: {
alias: config.resolve.alias,
alias: config.resolve?.alias,
...vueDocgenOptions,
},
},
Expand Down
8 changes: 4 additions & 4 deletions code/presets/vue3-webpack/src/framework-preset-vue3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const webpack: StorybookConfig['webpack'] = (config) => {
return {
...config,
plugins: [
...config.plugins,
...(config.plugins ?? []),
new VueLoaderPlugin(),
new DefinePlugin({
__VUE_OPTIONS_API__: JSON.stringify(true),
Expand All @@ -16,7 +16,7 @@ export const webpack: StorybookConfig['webpack'] = (config) => {
module: {
...config.module,
rules: [
...config.module.rules,
...(config.module?.rules ?? []),
{
test: /\.vue$/,
loader: require.resolve('vue-loader'),
Expand Down Expand Up @@ -51,9 +51,9 @@ export const webpack: StorybookConfig['webpack'] = (config) => {
},
resolve: {
...config.resolve,
extensions: [...config.resolve.extensions, '.vue'],
extensions: [...(config.resolve?.extensions ?? []), '.vue'],
alias: {
...config.resolve.alias,
...config.resolve?.alias,
vue$: require.resolve('vue/dist/vue.esm-bundler.js'),
},
},
Expand Down
2 changes: 1 addition & 1 deletion code/presets/vue3-webpack/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"compilerOptions": {
"resolveJsonModule": true,
"skipLibCheck": true,
"strict": false
"strict": true
},
"include": ["src/**/*"]
}

0 comments on commit e329ab1

Please sign in to comment.