1

Maybe this is about a tsconfig problem, but I don't know what is correct. I use the template app-template-react-typescript, and I find that when I use src/page it works.

Here is my tsconfig

{
  "include": ["src", "types"],
  "exclude": ["node_modules"],
  "extends": "@snowpack/app-scripts-react/tsconfig.base.json",
  "compilerOptions": {
    // You can't currently define paths in your 'extends' config,
    // so we have to set 'baseUrl' & 'paths' here.
    // Don't change these unless you know what you're doing.
    // See: https://github.com/microsoft/TypeScript/issues/25430
    "experimentalDecorators": true,
    "baseUrl": "./",
    "paths": {
      "stylesheet/*": ["src/asset/stylesheet/*"],
      "image/*": ["src/asset/image/*"],
      "shared/*": ["src/shared/*"],
      "layout/*": ["src/layout/*"],
      "component/*": ["src/component/*"],
      "page/*": ["src/page/*"],
      "utils/*": ["src/utils/*"],
      "constant/*": ["src/constant/*"],
      "store/*": ["src/store/*"],
      "src/*":["src/*"]
    }
    // Feel free to add/edit new config options below:
    // ...
  }
}
Steve Shipway
  • 3,754
  • 3
  • 22
  • 39

1 Answers1

2

already got answer fron snowpack team ,they say : We don't currently support TSConfig paths, but we have a PR out to add: pikapkg/snowpack#432 Until then, you'd need to import by "src/page/Account" for Snowpack to properly recognize it

so i will close this question and temporarily use 'src/page/Account' to solve my problem