Skip to content
This repository has been archived by the owner on Sep 28, 2023. It is now read-only.

feature request: add support for nuxt.config.js|ts's srcDir option #15

Open
miclgael opened this issue Jun 24, 2023 · 1 comment
Open

Comments

@miclgael
Copy link

miclgael commented Jun 24, 2023

Hi and thanks for your work so far on this plug-in.

Problem

I keep my core nuxt directories in a src folder in the root of my projects, using the srcDir option in NuxtConfig.

To get storybook-addon-nuxt to work with my setup, I need to include a components folder in the root, with a dummy component. I can get by with this work-around, but it would be great if auto-imports worked with this configuration.

Docs

https://nuxt.com/docs/api/configuration/nuxt-config#srcdir

Screenshot

image

Workaround

<!-- ./components/StorybookAddonNuxtFix.vue -->
<template>
  <h1>:)</h1>
  <!--
    This component is a workaround for a bug in the Nuxt Storybook addon.
    @link: https://github.com/hirotaka/storybook-addon-nuxt/issues/15
  -->
</template>

@miclgael miclgael changed the title feat: add support for nuxt.config.js|ts's srcDir option feature request: add support for nuxt.config.js|ts's srcDir option Jun 24, 2023
@miclgael
Copy link
Author

miclgael commented Jun 29, 2023

Update: another issue with this is that app.config.ts also needs to be duplicated for this module to work.

PS - I'd be happy to make a PR if I could have a little guidance on where in the code I might work on it.

Another workaround

// place in root dir
import config from './src/app.config'

import { defineAppConfig } from 'nuxt/dist/app/nuxt.js'

export default defineAppConfig(config)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant