Ionic2 Beta没有创建app.bundle.js

时间:2016-09-06 11:10:12

标签: angular ionic2

我运行了以下命令:

npm install -g ionic@beta
ionic start cutePuppyPics --v2
cd cutePuppyPics
ionic serve

工作正常

我停止了离子

我在gulp文件中做了一些更改

gulp.task('clean', function(){
  return del('www/build/js');
});

现在我的gulpfile如下:

var gulp = require('gulp'),
    gulpWatch = require('gulp-watch'),
    del = require('del'),
    runSequence = require('run-sequence'),
    argv = process.argv;


/**
 * Ionic hooks
 * Add ':before' or ':after' to any Ionic project command name to run the specified
 * tasks before or after the command.
 */
gulp.task('serve:before', ['watch']);
gulp.task('emulate:before', ['build']);
gulp.task('deploy:before', ['build']);
gulp.task('build:before', ['build']);

// we want to 'watch' when livereloading
var shouldWatch = argv.indexOf('-l') > -1 || argv.indexOf('--livereload') > -1;
gulp.task('run:before', [shouldWatch ? 'watch' : 'build']);

/**
 * Ionic Gulp tasks, for more information on each see
 * https://github.com/driftyco/ionic-gulp-tasks
 *
 * Using these will allow you to stay up to date if the default Ionic 2 build
 * changes, but you are of course welcome (and encouraged) to customize your
 * build however you see fit.
 */
var buildBrowserify = require('ionic-gulp-browserify-typescript');
var buildSass = require('ionic-gulp-sass-build');
var copyHTML = require('ionic-gulp-html-copy');
var copyFonts = require('ionic-gulp-fonts-copy');
var copyScripts = require('ionic-gulp-scripts-copy');
var tslint = require('ionic-gulp-tslint');

var isRelease = argv.indexOf('--release') > -1;

gulp.task('watch', ['clean'], function(done){
  runSequence(
    ['sass', 'html', 'fonts', 'scripts'],
    function(){
      gulpWatch('app/**/*.scss', function(){ gulp.start('sass'); });
      gulpWatch('app/**/*.html', function(){ gulp.start('html'); });
      buildBrowserify({ watch: true }).on('end', done);
    }
  );
});

gulp.task('build', ['clean'], function(done){
  runSequence(
    ['sass', 'html', 'fonts', 'scripts'],
    function(){
      buildBrowserify({
        minify: isRelease,
        browserifyOptions: {
          debug: !isRelease
        },
        uglifyOptions: {
          mangle: false
        }
      }).on('end', done);
    }
  );
});

gulp.task('sass', buildSass);
gulp.task('html', copyHTML);
gulp.task('fonts', copyFonts);
gulp.task('scripts', copyScripts);
gulp.task('clean', function(){
  return del('www/build/js');
});
gulp.task('lint', tslint);

我添加了一些文件和文件夹来生成以下结构

dir

基本上我添加了仪表板文件夹,其中包含构建和输入文件夹中的一些更改

我再次运行 离子服务

  

我的 app.build.js app.build.map 现在不见了    它给出了404错误

1 个答案:

答案 0 :(得分:0)

我找到了一个解决方法:

  • 在package.json中将 ionic-gulp-browserify-typescript 的版本更改为旧版“1.1.0”(当前版本为2.0.0)
  • 运行命令 npm i

  • index.d.ts 重命名为 main.d.ts

Woohoo工作

相关问题