sahat / megaboilerplate

Handcrafted starter projects, optimized for simplicity and ease of use.
MIT License
3.83k stars 256 forks source link

Move asset source files #91

Open niallobrien opened 8 years ago

niallobrien commented 8 years ago

Hi, I think we should move the style & script source files out of the public directory (if using a build step) and into /assets for example. Then the build process will build into /public. Thoughts?

sahat commented 8 years ago

I agree. To be honest, I am a not a fan of the current project structure specifically when it comes to stylesheets. This makes it impossible to use PostCSS if you have main.css (PostCSS source) in the public directory which outputs main.css (PostCSS compiled), hence you cannot choose PostCSS with NPM as build tool right now. (At least with Sass and LESS you have different file extensions)

Adding discussion label to get some additional feedback on what's the best way to organize CSS under the following conditions:

  1. With AngularJS/React
  2. Without AngularJS/React
  3. Using plain CSS
  4. Using Sass, LESS, PostCSS
  5. NPM, Gulp, Webpack build tool
  6. No build tool / (express-middleware)
jarrydfillmore commented 8 years ago

+1!

niallobrien commented 8 years ago

I cannot speak for points 1 and 2, but I vote for /assets/scripts and /assets/styles 3, serve from /public 4, 5 & 6: serve from /assets directory as I mention above.

HansUXdev commented 8 years ago

^ I agree on the folder structure especially because it could help separate ES6 and ES5 code when it's complied. Also for 4 & 5 what do you think about adding build options for webpack and gulp like how react has an option setting?

This way for example we would have webpack css modules or post css options for things like pleeease, etc

niallobrien commented 8 years ago

Is this still something people want implemented?

niallobrien commented 8 years ago

I can do a PR but it probably wouldn't cover Angular & React.