Nativescript 角度本机种子,实时同步在windows 10中不起作用

Nativescript 角度本机种子,实时同步在windows 10中不起作用,nativescript,angular2-nativescript,nativescript-angular,nativescript-plugin,Nativescript,Angular2 Nativescript,Nativescript Angular,Nativescript Plugin,在我的原生脚本项目中,我使用了angular原生种子。除了实时同步之外,一切都正常。问题列表下的git hub中也提出了同样的问题,但任何人都无法解决 每当文件更改时,都会调用gulp watch,但无法从src文件夹覆盖应用程序文件夹(请参阅下面提到的url线程中的最后注释) 网址: Gulpfile.js gulp.task('tns.Livesync', () => { return gulp.watch([`../${SRC}**/*.common.ts`, `../${SRC}*

在我的原生脚本项目中,我使用了angular原生种子。除了实时同步之外,一切都正常。问题列表下的git hub中也提出了同样的问题,但任何人都无法解决

每当文件更改时,都会调用gulp watch,但无法从src文件夹覆盖应用程序文件夹(请参阅下面提到的url线程中的最后注释)

网址:

Gulpfile.js

gulp.task('tns.Livesync', () => {
return gulp.watch([`../${SRC}**/*.common.ts`, `../${SRC}**/*.tns.ts`, `../${SRC}**/*.tns.html`,  `../${SRC}**/*.service.ts`,
 `../${SRC}**/*.tns.scss`, `../${SRC}**/*.scss`, `../${SRC}**/*.component.ts`, `../${SRC}**/*.routes.ts`,
 `../${SRC}**/*.index.ts`])
    .on('change', (file) => {
        var outputDest = file.substring(0, file.lastIndexOf('\\')+1).replace(SRC.substring(0, SRC.length - 1), DEST).replace('..\\', '');
        console.log('File-->' + file);
        console.log('Des-->' + outputDest);
        gulp.src([file])
            .pipe(rename(removeTns))
            .pipe(replace('.scss\'', '.css\'', { logs: { enabled: true }}))
            .pipe(debug({title: 'tns.Livesync'}))
            .pipe(debug({title: 'out ' + outputDest}))
            .pipe(gulp.dest(outputDest, {overwrite: true}));
    });
}))

有人帮我吗?

这是我的工作:

gulp.task('tns.Livesync', () => {
    return gulp.watch([`../${SRC}**/*.common.ts`, `../${SRC}**/*.tns.ts`, `../${SRC}**/*.tns.html`,  `../${SRC}**/*.service.ts`,
     `../${SRC}**/*.tns.scss`, `../${SRC}**/*.scss`, `../${SRC}**/*.component.ts`, `../${SRC}**/*.routes.ts`,
     `../${SRC}**/*.index.ts`])
        .on('change', (file) => {
            var outputDest = file.substring(0, file.lastIndexOf('\\')+1).replace('src\\', 'app\\').replace('..\\', '');
            gulp.src([file])
                .pipe(rename((path) => { path.dirname = ''; }))
                .pipe(rename(removeTns))
                .pipe(replace('.scss\'', '.css\'', { logs: { enabled: true }}))
                .pipe(debug({title: 'tns.Livesync'}))
                .pipe(debug({title: 'out ' + outputDest}))
                .pipe(gulp.dest(outputDest, {overwrite: true}));
        });
});

如果您使用的是
angular native seed
,请确保也运行任务
npm run livesync
,此操作有效,但仅适用于第一次livesync。当它再次运行时,css将丢失。