google / web-starter-kit

Web Starter Kit - a workflow for multi-device websites
http://developers.google.com/web/starter-kit
Apache License 2.0
18.43k stars 3.02k forks source link

How to handle the reference differences between src and dist? #901

Open aahoo opened 7 years ago

aahoo commented 7 years ago

In the gulpfile > script task:

    gulp.src([
      // Note: Since we are not using useref in the scripts build pipeline,
      //       you need to explicitly list your scripts here in the right order
      //       to be correctly concatenated
      './app/scripts/main.js'
      // Other scripts
    ])

We can add scripts to be concatenated and optimized which means that I should references a single main.min.js file in index.html. But then, I cannot use gulp serve for development because the script file in src/scripts is named main.js (not main.min.js) and there are a bunch of other scripts that are not referenced.

My workaround for now is to serve from dist directory with some watches added to the serve:dist gulp task. I am sure this is not the way WSK meant to be used. So please enlighten me :)

vorburger commented 7 years ago

https://github.com/google/web-starter-kit/issues/913 is somewhat related to this.