Я пытаюсь построить мое приложение Angular 2 & BreezeJS с помощью инструмента SystemJS Build через gulpfile. Однако, когда я пытаюсь выполнить задачу сборки, я получаю ошибку Multiple anonymous defines
.Angular 2 & BreezeJS & SystemJS Build - несколько анонимных определяет
С другой стороны, если я запустил приложение напрямую, включая system.js
и systemjs.config.js
на мою страницу, он работает без проблем.
Так что же означает эта ошибка, и можно ли создать мое приложение с помощью systemjs-builder?
- бриз-клиент: 1.6.0
- systemjs: 0.19.41
- systemjs-строитель: 0.15.34
systemjs.config.js
(function (global) {
"use strict";
System.config({
defaultJSExtensions: true,
paths: {
"npm:": "node_modules/"
},
map: {
"app": "app/main",
"@angular/core": "npm:@angular/core/bundles/core.umd",
"@angular/common": "npm:@angular/common/bundles/common.umd",
"@angular/compiler": "npm:@angular/compiler/bundles/compiler.umd",
"@angular/http": "npm:@angular/http/bundles/http.umd",
"@angular/platform-browser": "npm:@angular/platform-browser/bundles/platform-browser.umd",
"@angular/platform-browser-dynamic": "npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd",
"rxjs": "npm:rxjs",
"datajs": "npm:datajs/index",
"breeze-client": "npm:breeze-client/breeze.debug",
"breeze-bridge-angular2": "npm:breeze-bridge-angular2/index",
}
});
})(this);
gulpfile.js
"use strict";
var gulp = require("gulp");
gulp.task("build", function() {
var Builder = require("systemjs-builder");
var builder = new Builder("", "./systemjs.config.js");
return builder.buildStatic("app", "./app/app.js", { encodeNames: false })
.catch(function (error) {
console.log("error", error);
});
});