sondr3 / generator-jekyllized

A Yeoman generator for Jekyll to rapidly build sites using Gulp
MIT License
326 stars 35 forks source link

Resource don't load in `gulp` command after you run `gulp --prod` #129

Closed mariusmateoc closed 8 years ago

mariusmateoc commented 8 years ago

Steps to reproduce error:

Even with gulp command it will try to load the minified and concatenated files image

sondr3 commented 8 years ago

Are you sure this isn't a cache problem or something? I can't reproduce this locally following your steps, running gulp after gulp --prod just produces the dev site without the cache busted and so on assets on my end.

mariusmateoc commented 8 years ago

I have cleared the npm cache, browser cache, also removed dist and .tmp then run the gulp again but didn't work for me.

More information about my system:

$ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.11.4
BuildVersion:   15E65

$ node -v
v6.0.0

$ npm -v
3.8.6

$ gulp --version
[10:06:47] Requiring external module babel-core/register
[10:06:47] CLI version 0.4.0
[10:06:47] Local version 4.0.0-alpha.2

Steps:

  1. Generate new project with yo jekyllized
  2. Run gulp command
  3. Modify /src/assets/scss/style.scss then stop the gulp command
  4. Run gulp --prod command —> Everything ok —> then stop the command
  5. Run gulp again.

Now in dist and .tmp I have the right files /assets/javascript/index.js and /assets/stylesheets/style.css but in the /dist/index.html links to the old css that doesen't exist:

<!-- CSS -->
<!-- inject:css -->
<link rel="stylesheet" href="/assets/stylesheets/style-eb1e1d9904.min.css">
<!-- endinject -->

Now the /assets/javascript/index.js point to the right file:

<!-- JS -->
<!-- inject:js -->
<script src="/assets/javascript/index.js"></script>
<!-- endinject -->

In /src/_includes/head.html I have:

<!-- CSS -->
<!-- inject:css -->
<link rel="stylesheet" href="/assets/stylesheets/style-eb1e1d9904.min.css">
<!-- endinject -->

and /src/_layouts/default.html:

  <!-- JS -->
  <!-- inject:js -->
  <script src="/assets/javascript/index-7c3ad1fdd9.min.js"></script>
  <!-- endinject -->

Since didn't work so much with gulp the temp workaround that I find is to manually remove the style link from /src/_includes/head.html and script source from /src/_layouts/default.html between <!-- inject:css/js --> and <!-- endinject --> before run gulp command.

ferrarimarco commented 8 years ago

May this be related to #127 ?

Check for modifications in footer.html and head.html under src directory after running gulp --prod. In my case I spotted the issue because git status kept signalling changes in both files.

mariusmateoc commented 8 years ago

Yes I think is related to #127 . gulp --prod modify footer.html and head.html under src directory but just gulp didn't change it back to point to the right files, still points to old files.

ferrarimarco commented 8 years ago

I submitted a PR to solve this.

sondr3 commented 8 years ago

I'll look into both these when I'm on my computer during the weekend :) thanks to both of you