Build production on SystemJS with systemjs-builder

こ雲淡風輕ζ 提交于 2019-12-25 09:10:56

问题


I have my project that use SystemJS (i use a template that comes on this way).

I need to build the final project to production env. I read that i can use systemjs-builder for this. I read the official page: https://github.com/systemjs/builder.

Sorry, i'm so new on Angular 2! I don't understand how to start. For example, this part:

Basic Use

Ensure that the transpiler is installed separately (npm install babel-core here).

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);
});

What i should to do here? I must to install this package called babel? And after this? I need to create a file with that code? Where? what name must have this file? How i can execute?

Thanks for your help. Please, be patient with a new angular developer!

来源:https://stackoverflow.com/questions/43334967/build-production-on-systemjs-with-systemjs-builder

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!