Я следую этому руководству. http://www.c-sharpcorner.com/article/using-mvc-6-and-angularjs-2-with-net-core/Gulp не копирует Angular2 в lib-npm
Я получил возможность использовать gulp для копирования файлов в папку lib-npm. Все ожидаемые файлы копируются, кроме угловых. Я не получаю сообщение об ошибке, файлы просто есть.
вот мой Глоток файл
/// <binding />
/*
This file in the main entry point for defining Gulp tasks and using Gulp plugins.
Click here to learn more. http://go.microsoft.com/fwlink/?LinkId=518007
*/
"use strict";
var gulp = require("gulp");
var root_path = {
webroot: "./wwwroot/"
};
//library source
root_path.nmSrc = "./node_modules/";
//library destination
root_path.package_lib = root_path.webroot + "lib-npm/";
gulp.task("copy-systemjs", function() {
return gulp.src(root_path.nmSrc + '/systemjs/dist/**/*.*', {
base: root_path.nmSrc + '/systemjs/dist/'
}).pipe(gulp.dest(root_path.package_lib + '/systemjs/'));
});
gulp.task("copy-angular2", function() {
return gulp.src(root_path.nmSrc + '/angular2/bundles/**/*.js', {
base: root_path.nmSrc + '/angular2/bundles/'
}).pipe(gulp.dest(root_path.package_lib + '/angular2/'));
});
gulp.task("copy-es6-shim", function() {
return gulp.src(root_path.nmSrc + '/es6-shim/es6-sh*', {
base: root_path.nmSrc + '/es6-shim/'
}).pipe(gulp.dest(root_path.package_lib + '/es6-shim/'));
});
gulp.task("copy-rxjs", function() {
return gulp.src(root_path.nmSrc + '/rxjs/bundles/*.*', {
base: root_path.nmSrc + '/rxjs/bundles/'
}).pipe(gulp.dest(root_path.package_lib + '/rxjs/'));
});
gulp.task("copy-all", ["copy-rxjs", 'copy-angular2', 'copy-systemjs', 'copy-es6-shim']);
Я также заметил, что моя. \ Node_modules \ папка Angular2 в моем проекте не имеет .js файлов в нем. Это нормально?
Angular2 версия 1.0.2
Я получаю следующие ошибки в сборке, поскольку отсутствуют файлы
Cannot find name 'Component'.
Build:Cannot find module 'angular2/core'.
Build:Cannot find module 'angular2/platform/browser'.
Build:Cannot find name 'Component'.
Cannot find module 'angular2/core'.
Cannot find module 'angular2/platform/browser'
Извините, но не исправить проблему У меня все еще есть угловые файлы в моей папке lib-npm, и я получаю ошибки сборки, которых они не хватает. Не удается найти имя «Компонент». Сборка: Не удается найти модуль «угловой2/сердечник». Сборка: Невозможно найти модуль 'angular2/platform/browser'. Сборка: Не удается найти имя «Компонент». Не удается найти модуль 'angular2/core'. Не удается найти модуль 'angular2/platform/browser'. – TheColonel26
Оказывается, я использовал неправильный угловой пакет 2, это был старый пакет перед выпуском. Но я принял ваш совет, и я использую трюк статических файлов. – TheColonel26