bassjobsen / generator-foundation6

Yeoman generator to scaffold out a front-end Foundation 6 Web app
26 stars 7 forks source link

Styles and scripts missing from dist folder #3

Open petersandor opened 8 years ago

petersandor commented 8 years ago

Hi! I just installed this generator. I noticed that no script and styles are copied into the dist directory when I try to build the project. So when I run grunt serve:dist and I look into the console log in the browser I see the following:

Failed to load resource: the server responded with a status of 404 (Not Found)
http://localhost:3000/scripts/vendor.js Failed to load resource: the server responded with a status of 404 (Not Found)
http://localhost:3000/scripts/main.js Failed to load resource: the server responded with a status of 404 (Not Found)
http://localhost:3000/scripts/vendor.js Failed to load resource: the server responded with a status of 404 (Not Found)
http://localhost:3000/scripts/main.js Failed to load resource: the server responded with a status of 404 (Not Found)
http://localhost:3000/styles/main.css Failed to load resource: the server responded with a status of 404 (Not Found)

I'm not sure if I'm doing something wrong, I haven't changed anything.

bassjobsen commented 8 years ago

Hi @petersandor

Thanks for your message. I can not confirm your issues. I have tested all with the latest source. Did you run the 'gulp' command before the gulp serve command?

Did the gulp command gives you any errors?

I'm testing on linux.

Best regards,

Bass

petersandor commented 8 years ago

I ran grunt first, with no errors (see the log here http://pastebin.com/q5VMcjUj).

This is what I have in my dist folder:

Projects/test-yo/dist/
├── apple-touch-icon.9727d3c2.png
├── favicon.b25e58c4.ico
├── index.html
└── robots.txt
bassjobsen commented 8 years ago

yes but browser sync serves the files from /app/ and .tmp:

Running "browserSync:livereload" (browserSync) task [BS] Access URLs:


   Local: http://localhost:9000
External: http://192.168.2.3:9000

      UI: http://localhost:3001

UI External: http://192.168.2.3:3001


[BS] Serving files from: .tmp [BS] Serving files from: app

powellian commented 8 years ago

@petersandor I had exactly the same issue, same stuff missing from my build. I've fixed it with the following updates in Gruntfile.js:

uncomment the following tasks: cssmin, uglify, concat in copy task add: scripts/*.js in grunt.registerTask('build' ... uncomment: concat, cssmin, uglify

Then run grunt and everything falls into place inside dist

bassjobsen commented 8 years ago

@petersandor thanks for your comments. I wonder now, if this is a bug. The babel:dist task should also copy the JavaScript files? And the concat, cssmin and uglify tasks should only modify the compiled code.

powellian commented 8 years ago

I've done another update as /images/ wasn't copying over in build, but does now after editing the following:

So far I've found these updates copy the images dir recursively. Am applying the same principle to css but this is WIP as I write.