Skip to content

Commit 2c5456f

Browse files
chakAs3tobiasdiez
andauthored
fix: readd vue-tempate-compilation plugin (#831)
<!-- ☝️ PR title should follow conventional commits (https://conventionalcommits.org). In particular, the title should start with one of the following types: - docs: 📖 Documentation (updates to the documentation or readme) - fix: 🐞 Bug fix (a non-breaking change that fixes an issue) - feat: ✨ New feature/enhancement (a non-breaking change that adds functionality or improves existing one) - feat!/fix!: ⚠️ Breaking change (fix or feature that would cause existing functionality to change) - chore: 🧹 Chore (updates to the build process or auxiliary tools and libraries) --> ### 🔗 Linked issue Fixes #808 and fixes #805. <!-- If it resolves an open issue, please link the issue here. For example "Resolves #123" --> ### 📚 Description <!-- Describe your changes in detail --> <!-- Why is this change required? What problem does it solve? --> This PR reverts #740 that removes of the vue-templation-template plugin, which was initially extended from the vue3-vite project vite config. However, removing it only masked the memory issue rather than addressing its root cause—the resolution of the vue ESM bundler alias. The vue-templation-template plugin is essential for rendering stories with custom string templates, so we need to retain it. To work around the memory issue and ensure template compilation works correctly, i have added vue as a dependency in the root project. ( playground ) The underlying problem appears to be related to how the vue alias is resolved. When it isn’t found in the root project, some unusual string replacement occurs, leading to recursive paths and the memory issue. Further investigation may be needed to fully understand why vue cannot be resolved from sub-packages. --------- Co-authored-by: Tobias Diez <[email protected]>
1 parent d8f4ca8 commit 2c5456f

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

packages/storybook-addon/src/preset.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -159,16 +159,6 @@ function mergeViteConfig(
159159
plugins.unshift(vuePlugin())
160160
}
161161

162-
// Remove the 'storybook:vue-template-compilation' plugin because it yields out-of-memory issues
163-
const templatePluginIndex = plugins?.findIndex(
164-
(plugin) =>
165-
plugin &&
166-
'name' in plugin &&
167-
plugin.name === 'storybook:vue-template-compilation',
168-
)
169-
if (templatePluginIndex !== -1) {
170-
plugins.splice(templatePluginIndex, 1)
171-
}
172162
extendedConfig.plugins = plugins
173163

174164
// Storybook adds 'vue' as dependency that should be optimized, but nuxt explicitly excludes it from pre-bundling

playground/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"@storybook/addon-interactions": "8.4.7",
1818
"@storybook/addon-links": "8.4.7",
1919
"nuxt": "3.14.1592",
20+
"vue": "3.5.13",
2021
"storybook": "8.4.7",
2122
"vite-plugin-inspect": "0.10.3"
2223
}

pnpm-lock.yaml

Lines changed: 9 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)