redsnake
New composable undetected
1 - i don't have composables/index.ts
my nuxt.config.ts is
2 - yes that's my point, i'm certainly missing smth
3 - i tried nuxi dev and build
4 - i dont want explicit imports, i want to fit to the existing
5 - alr done in 1
typescript
import pkg from './package.json';
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
ssr: false,
devtools: { enabled: true },
runtimeConfig: {
FORMKIT_PRO_KEY: process.env.FORMKIT_PRO_KEY,
MAPBOX_KEY: process.env.MAPBOX_KEY,
appUrl: process.env.APP_URL,
apiUrl: process.env.API_URL,
clientVersion: pkg.version,
public: {
FORMKIT_PRO_KEY: process.env.FORMKIT_PRO_KEY,
MAPBOX_KEY: process.env.MAPBOX_KEY,
appUrl: process.env.APP_URL,
apiUrl: process.env.API_URL,
clientVersion: pkg.version,
MEDIA_BUCKET_URL: process.env.MEDIA_BUCKET_URL,
MEDIA_BUCKET_NAME: process.env.MEDIA_BUCKET_NAME,
MEDIA_BUCKET_TOKEN: process.env.MEDIA_BUCKET_TOKEN,
MEDIA_BUCKET_SECRET: process.env.MEDIA_BUCKET_SECRET,
NUXT_PUBLIC_VELOCERTIFIE_FEE_GLOBAL:
process.env.NUXT_PUBLIC_VELOCERTIFIE_FEE_GLOBAL ?? '467',
NUXT_PUBLIC_VELOCERTIFIE_FEE_BIKE_SHOP:
process.env.NUXT_PUBLIC_VELOCERTIFIE_FEE_BIKE_SHOP ?? '190',
NUXT_PUBLIC_VELOCERTIFIE_FEE_VC:
process.env.NUXT_PUBLIC_VELOCERTIFIE_FEE_VC ?? '175',
NUXT_PUBLIC_VELOCERTIFIE_FEE_OTHER_COSTS:
process.env.NUXT_PUBLIC_VELOCERTIFIE_FEE_OTHER_COSTS ?? '102',
PICKUP_AT_PARTNER_SHOP_FEE: process.env.PICKUP_AT_PARTNER_SHOP_FEE ?? '0',
DELIVERY_AT_PARTNER_SHOP_FEE:
process.env.DELIVERY_AT_PARTNER_SHOP_FEE ?? '120',
DELIVERY_AT_HOME_FEE: process.env.DELIVERY_AT_HOME_FEE ?? '60',
},
},
app: {
head: {
title: 'VeloCertifié',
link: [
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
{
rel: 'icon',
type: 'image/png',
sizes: '32x32',
href: '/favicon-32x32.png',
},
{
rel: 'icon',
type: 'image/png',
sizes: '16x16',
href: '/favicon-16x16.png',
},
{
rel: 'apple-touch-icon',
sizes: '180x180',
href: '/apple-touch-icon.png',
},
{ rel: 'manifest', href: '/site.webmanifest' },
{
hid: 'mapbox-gl',
rel: 'stylesheet',
type: 'text/css',
href: 'https://api.mapbox.com/mapbox-gl-js/v2.8.1/mapbox-gl.css',
},
{
hid: 'Hurricane',
rel: 'stylesheet',
href: 'https://fonts.googleapis.com/css2?family=Hurricane&display=swap',
},
],
},
},
modules: [
'@nuxtjs/tailwindcss',
[
'@pinia/nuxt',
{
autoImports: [['defineStore', 'definePiniaStore'], 'acceptHMRUpdate'],
},
],
'@vueuse/nuxt',
'@pinia-plugin-persistedstate/nuxt',
[
'@formkit/nuxt',
{
configFile: './formkit/formkit.config.ts',
},
],
],
imports: {
// Auto-import pinia stores defined in `~/stores`
dirs: ['stores', 'types', 'composables/api'],
// Auto-import all .ts files as a composable named with camelCase
presets: [
{
from: 'vue-i18n',
imports: ['useI18n'],
},
],
},
});
typescript
import pkg from './package.json';
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
ssr: false,
devtools: { enabled: true },
runtimeConfig: {
FORMKIT_PRO_KEY: process.env.FORMKIT_PRO_KEY,
MAPBOX_KEY: process.env.MAPBOX_KEY,
appUrl: process.env.APP_URL,
apiUrl: process.env.API_URL,
clientVersion: pkg.version,
public: {
FORMKIT_PRO_KEY: process.env.FORMKIT_PRO_KEY,
MAPBOX_KEY: process.env.MAPBOX_KEY,
appUrl: process.env.APP_URL,
apiUrl: process.env.API_URL,
clientVersion: pkg.version,
MEDIA_BUCKET_URL: process.env.MEDIA_BUCKET_URL,
MEDIA_BUCKET_NAME: process.env.MEDIA_BUCKET_NAME,
MEDIA_BUCKET_TOKEN: process.env.MEDIA_BUCKET_TOKEN,
MEDIA_BUCKET_SECRET: process.env.MEDIA_BUCKET_SECRET,
NUXT_PUBLIC_VELOCERTIFIE_FEE_GLOBAL:
process.env.NUXT_PUBLIC_VELOCERTIFIE_FEE_GLOBAL ?? '467',
NUXT_PUBLIC_VELOCERTIFIE_FEE_BIKE_SHOP:
process.env.NUXT_PUBLIC_VELOCERTIFIE_FEE_BIKE_SHOP ?? '190',
NUXT_PUBLIC_VELOCERTIFIE_FEE_VC:
process.env.NUXT_PUBLIC_VELOCERTIFIE_FEE_VC ?? '175',
NUXT_PUBLIC_VELOCERTIFIE_FEE_OTHER_COSTS:
process.env.NUXT_PUBLIC_VELOCERTIFIE_FEE_OTHER_COSTS ?? '102',
PICKUP_AT_PARTNER_SHOP_FEE: process.env.PICKUP_AT_PARTNER_SHOP_FEE ?? '0',
DELIVERY_AT_PARTNER_SHOP_FEE:
process.env.DELIVERY_AT_PARTNER_SHOP_FEE ?? '120',
DELIVERY_AT_HOME_FEE: process.env.DELIVERY_AT_HOME_FEE ?? '60',
},
},
app: {
head: {
title: 'VeloCertifié',
link: [
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
{
rel: 'icon',
type: 'image/png',
sizes: '32x32',
href: '/favicon-32x32.png',
},
{
rel: 'icon',
type: 'image/png',
sizes: '16x16',
href: '/favicon-16x16.png',
},
{
rel: 'apple-touch-icon',
sizes: '180x180',
href: '/apple-touch-icon.png',
},
{ rel: 'manifest', href: '/site.webmanifest' },
{
hid: 'mapbox-gl',
rel: 'stylesheet',
type: 'text/css',
href: 'https://api.mapbox.com/mapbox-gl-js/v2.8.1/mapbox-gl.css',
},
{
hid: 'Hurricane',
rel: 'stylesheet',
href: 'https://fonts.googleapis.com/css2?family=Hurricane&display=swap',
},
],
},
},
modules: [
'@nuxtjs/tailwindcss',
[
'@pinia/nuxt',
{
autoImports: [['defineStore', 'definePiniaStore'], 'acceptHMRUpdate'],
},
],
'@vueuse/nuxt',
'@pinia-plugin-persistedstate/nuxt',
[
'@formkit/nuxt',
{
configFile: './formkit/formkit.config.ts',
},
],
],
imports: {
// Auto-import pinia stores defined in `~/stores`
dirs: ['stores', 'types', 'composables/api'],
// Auto-import all .ts files as a composable named with camelCase
presets: [
{
from: 'vue-i18n',
imports: ['useI18n'],
},
],
},
});
6 replies