Construct 3 r361

You're viewing a single comment in a conversation. View all the comments
  • 4 Comments

  • Order by
  • I've set up typescript but I'm not sure whether I'm missing some step. When I update the typescript file and run the project preview again the code is not transpiled automatically as the release notes suggest.

      • [-] [+]
      • 1
      • Ashley's avatar
      • Ashley
      • Construct Team Founder
      • 1 points
      • (2 children)

      In VS Code press Ctrl+Shift+B and select 'watch' to enable auto-compilation.

      • The 'import { Utils } from "./utils";' in the 'ts' file was translated into a' js' file and changed to 'import { Utils } from "./utils";', but 'import { Utils } from "./utils";' cannot function properly because it lacks the '.js' suffix name

          • [-] [+]
          • 1
          • Ashley's avatar
          • Ashley
          • Construct Team Founder
          • 1 points
          • (0 children)

          Just import as "./utils.js" even in your TypeScript file - then it's correct after compilation, and TypeScript still knows that you mean to import "./utils.ts" in your TypeScript code.