Tresjs / tres

Declarative ThreeJS using Vue Components
https://tresjs.org
MIT License
1.91k stars 85 forks source link

chore(docs): Fix OrbitControls docs missing ".js" extension #671

Open nwittwer opened 2 months ago

nwittwer commented 2 months ago

Added missing .js suffix for importing OrbitControls from the three package (since it's not a TS file).

Before:

import { OrbitControls } from 'three/addons/controls/OrbitControls

After:

import { OrbitControls } from 'three/addons/controls/OrbitControls.js

I'm using this in a Nuxt project (@tresjs/nuxt package)—maybe I just need to configure my TS Module Resolutions or some other TS settings? Using the default Nuxt tsconfig.json:

{
  "extends": "./.nuxt/tsconfig.json"
}

Update 1 Modifying the project-level tsconfig.json to the following enables .js files to resolve:

{
  "extends": "./.nuxt/tsconfig.json",
  "compilerOptions": {
    "moduleResolution": "node",
    "baseUrl": ".",
    "paths": {
      "~/*": [
        "./*"
      ],
      "@/*": [
        "./*"
      ],
      "*": [
        "*",
        "*.ts",
        "*.js"
      ]
    },
  }
}
netlify[bot] commented 2 months ago

Deploy Preview for tresjs-docs ready!

Name Link
Latest commit fa2bab1591e93473aebd249ade66e6285c29807a
Latest deploy log https://app.netlify.com/sites/tresjs-docs/deploys/6631fd263d318e000842b23f
Deploy Preview https://deploy-preview-671--tresjs-docs.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.