primefaces / primevue-nuxt-module

MIT License
70 stars 11 forks source link

fix: normalize file paths for Windows #53

Closed Lehoczky closed 2 months ago

Lehoczky commented 5 months ago

When using importPT with path.resolve on Windows, the \ characters are not escaped, leading to "failed to resolve import" errors.

This PR addresses this issue.

image

vanozi commented 4 months ago

can this PR be merged? I also encouter the same issue

Msalati commented 4 months ago

Hi, This PR needs to be merged, I'm also encountering the same issue. @mertsincan

Lehoczky commented 4 months ago

Since the primevue team don't seem to be interested in external contributions (they ignore even very small PRs for weeks, sometimes a month in their other repositories as well), I have a workaround for you guys that you can use in your codebase.

First, install pathe:

npm i -D pathe

Then do the path normalization in your own nuxt.config.ts:

import { resolve } from 'pathe';

export default defineNuxtConfig({
   primevue: {
        options: {
            unstyled: true
        },
        // pathe will automatically change Windows-style `\` to `/` and therefore solves this issue
        importPT: { from: resolve(__dirname, './presets/lara/') }
    },
})

I must say though, that it's a shame they don't engage with the community. I've seen issues and other good PRs being ignored for really long times. Primevue would be a great library, but this is very discouraging.

Msalati commented 4 months ago

Since the primevue team don't seem to be interested in external contributions (they ignore even very small PRs for weeks, sometimes a month in their other repositories as well), I have a workaround for you guys that you can use in your codebase.

First, install pathe:

npm i -D pathe

Then do the path normalization in your own nuxt.config.ts:

import { resolve } from 'pathe';

export default defineNuxtConfig({
   primevue: {
        options: {
            unstyled: true
        },
        // pathe will automatically change Windows-style `\` to `/` and therefore solves this issue
        importPT: { from: resolve(__dirname, './presets/lara/') }
    },
})

I must say though, that it's a shame they don't engage with the community. I've seen issues and other good PRs being ignored for really long times. Primevue would be a great library, but this is very discouraging.

Thank you so much for your help 🙏