Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Double quotes replaced by single quotes in source files on gulp build #709

Closed
isaacalves opened this issue Feb 19, 2018 · 1 comment
Closed

Comments

@isaacalves
Copy link

If i have my working tree clean, run gulp build and then git status, I see that all my files inside /scripts have changed. If I do diff I see that all my double quotes had been replace by single quotes:

-import Stats from "stats.js";
+import Stats from 'stats.js';

Any idea what is going on? Why do these files get replaced on gulp build? Could this be Prettier.js?
My build related tasks do nothing with Prettier anyway.

Here are my build related tasks (pretty much the same as in the boilerplate):



gulp.task("lint", () => {
  return lint("app/scripts/**/*.js").pipe(gulp.dest("app/scripts"));
});
gulp.task("lint:test", () => {
  return lint("test/spec/**/*.js").pipe(gulp.dest("test/spec"));
});

gulp.task("html", ["styles", "scripts"], () => {
  return gulp
    .src("app/*.html")
    .pipe($.useref({ searchPath: [".tmp", "app", "."] }))
    .pipe($.if(/\.js$/, $.uglify({ compress: { drop_console: true } })))
    .pipe($.if(/\.css$/, $.cssnano({ safe: true, autoprefixer: false })))
    .pipe(
      $.if(
        /\.html$/,
        $.htmlmin({
          collapseWhitespace: true,
          minifyCSS: true,
          minifyJS: { compress: { drop_console: true } },
          processConditionalComments: true,
          removeComments: true,
          removeEmptyAttributes: true,
          removeScriptTypeAttributes: true,
          removeStyleLinkTypeAttributes: true
        })
      )
    )
    .pipe(gulp.dest("dist"));
});

gulp.task("images", () => {
  return gulp
    .src("app/images/**/*")
    .pipe($.cache($.imagemin()))
    .pipe(gulp.dest("dist/images"));
});

gulp.task("fonts", () => {
  return gulp
    .src(
      require("main-bower-files")("**/*.{eot,svg,ttf,woff,woff2}", function(
        err
      ) {}).concat("app/fonts/**/*")
    )
    .pipe($.if(dev, gulp.dest(".tmp/fonts"), gulp.dest("dist/fonts")));
});

gulp.task("extras", () => {
  return gulp
    .src(["app/*", "!app/*.html"], {
      dot: true
    })
    .pipe(gulp.dest("dist"));
});

gulp.task("build", ["lint", "html", "images", "fonts", "extras"], () => {
  return gulp.src("dist/**/*").pipe($.size({ title: "build", gzip: true }));
});

@UlisesGascon
Copy link
Member

I assume that this bug was fixed in #737. If not we can re-open it again 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants