在一个文件中捆绑jspm

时间:2016-03-01 13:59:03

标签: typescript jspm

我在使用jspm捆绑脚本时遇到问题。我将jspm的0.16.30版本安装为dev依赖和全局。

当我尝试捆绑时,我收到以下错误:

  

未捕获的ReferenceError:未定义系统

这是我的config.js的顶部(我排除了地图等):

baseURL: "/",
  defaultJSExtensions: true,
  transpiler: "typescript",
  typescriptOptions: {
    "module": "commonjs",
    "emitDecoratorMetadata": true
  },
  paths: {
    "npm:*": "jspm_packages/npm/*",
    "github:*": "jspm_packages/github/*"
  },

  packages: {
    "app": {
      "main": "main",
      "defaultExtension": "ts"
    }
  },

我用以下命令捆绑:

jspm bundle-sfx app/main .\public\app.js

这似乎很好:

     Building the single-file sfx bundle for app/main...
ok   Built into public\app.js with source maps, unminified.

以下是我在index.html中设置的全部内容:

<body>
    <my-app>Loading...</my-app>

    <script src="app.js"></script>
    <script>
        System.import("app");
    </script>
</body>

真的很感激任何帮助:)

0 个答案:

没有答案
相关问题