LoginSignup
1
0

More than 5 years have passed since last update.

Angular2 の quickstart を試していたら GET /traceur 404 (Not Found) が出て二進も三進も行かなくなった場合の対応方法

Last updated at Posted at 2016-12-05

取り急ぎ、

$ npm install plugin-typescript --save

plugin-typescript をインストールして、

$ git diff systemjs.config.js
diff --git a/systemjs.config.js b/systemjs.config.js
index ...
--- a/systemjs.config.js
+++ b/systemjs.config.js
@@ -4,9 +4,28 @@
  */
 (function (global) {
   System.config({
+    transpiler: 'ts',
+    typescriptOptions: {
+      // Copy of compiler options in standard tsconfig.json
+      target: 'es5',
+      module: 'commonjs',
+      moduleResolution: 'node',
+      sourceMap: true,
+      emitDecoratorMetadata: true,
+      experimentalDecorators: true,
+      lib: [ 'es2015', 'dom' ],
+      noImplicitAny: true,
+      suppressImplicitAnyIndexErrors: true
+    },
+    meta: {
+      typescript: {
+        exports: 'ts'
+      }
+    },
     paths: {
       // paths serve as alias
       'npm:': 'node_modules/'
     },
     // map tells the System loader where to look for things
     map: {
@@ -24,8 +43,10 @@
       '@angular/forms': 'npm:@angular/forms/bundles/forms.umd.js',

       // other libraries
       rxjs: 'npm:rxjs',
+      ts: 'npm:plugin-typescript/lib/plugin.js',
+      typescript: 'npm:typescript/lib/typescript.js',
       'angular-in-memory-web-api': 'npm:angular-in-memory-web-api/bundles/in-memory-web-api.umd.js'
     },
     // packages tells the System loader how to load when no filename and/or no extension
     packages: {
       app: {
-        main: './main.js',
-        defaultExtension: 'js'
+        main: './main.ts',
+        defaultExtension: 'ts'
       },
       rxjs: {
         defaultExtension: 'js'

systemjs.config.js を修正する。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0