0

我有使用 SystemJS 的项目(我使用以这种方式提供的模板)。

我需要将最终项目构建到生产环境中。我读到我可以为此使用 systemjs-builder 。我阅读了官方页面:https ://github.com/systemjs/builder 。

抱歉,我对 Angular 2 太陌生了!我不明白如何开始。例如这部分:

基本使用

确保单独安装转译器(此处为 npm install babel-core)。

var path = require("path");
var Builder = require('systemjs-builder');

// optional constructor options
// sets the baseURL and loads the configuration file
var builder = new Builder('path/to/baseURL', 'path/to/system/config-file.js');

builder
.bundle('local/module.js', 'outfile.js')
.then(function() {
  console.log('Build complete');
})
.catch(function(err) {
  console.log('Build error');
  console.log(err);
});

我应该在这里做什么?我必须安装这个叫做 babel 的包吗?在这之后呢?我需要使用该代码创建一个文件吗?在哪里?什么名字必须有这个文件?我该如何执行?

谢谢你的帮助。请耐心等待新的 Angular 开发人员!

4

0 回答 0