Summer-Sky
Summer-Sky

Reputation: 481

aurelia browser loading main.ts not main.js

i am new to aurelia, and when including it into my project as the api frontend i ran into an issue i need clarification about.

i followed the basic starting guide and made sure the code could load. which it does if i name the main.js as main.ts (and app.js also).

due to the fact, that i did not find any explanation or configuation option in the code nor "the internet" i wonder what i did do wrong

does someone else did have that problem.

it tries to load typescript even though the documentation says app.js there

Minimal Project

  1. download http://aurelia.io/downloads/basic-aurelia-project.zip
  2. copy the code in http://aurelia.io/hub.html#/doc/article/aurelia/framework/latest/quick-start as js
  3. run any webserver with it. (e.g. python -m SimpleHTTPServer 8000)

Upvotes: 1

Views: 842

Answers (1)

Ovidiu Dolha
Ovidiu Dolha

Reputation: 5413

The startup package is configured by default to work with TypeScript so to change this you need to replace the script

<script src="scripts/config-typescript.js"></script>

in index.html with

<script src="scripts/config-esnext.js"></script>

to use Javascript / ES next

This is mentioned in the documentation but may be easily missed, and the rest of the startup documentation follows the javascript approach.

Note that this tutorial is a quick startup - a more comprehensive one is http://aurelia.io/hub.html#/doc/article/aurelia/framework/latest/contact-manager-tutorial and some more alternative seeds (e.g. JSPM / webpack) can be found in this repo: https://github.com/aurelia/skeleton-navigation

Upvotes: 3

Related Questions