naviapps / create-nw-react-app

Create NW.js React apps with no build configuration.
MIT License
144 stars 14 forks source link

How to add path alias to project #66

Open Spider149 opened 1 year ago

Spider149 commented 1 year ago

I'm developing with js. Added jsconfig.json but the path like "@components/somecomponent" can not be resolved. My jsconfig.json

{
    "compilerOptions": {
        "baseUrl": ".",
        "paths": {
            "@components/*": ["./src/components/*"]
        }
    },
    "include": ["src"]
}

Vscode intelligence still suggest the @components but when I'm running npm run start, this path can't be resolved.

DeveloperBlue commented 5 months ago

I am currently experiencing this issue.

In addition to adding path aliases to the tsconfig, they must also be mirrored in the Webpack config. As far as I know, the only option at present is to eject.

It would be nice to have #58 to allow webpack config injections