|- node_modules/
|- src/
| |
| |- index.js/ <----------- uses browserify so anything in node_modules is game for require()
| | |- index.js
| | '- foo.coffee
| |
| |- index.css/ <---------- uses topcoatify so anything in node_modules is game. how import/etc works needs consideration
| | |- index.css
| | '- bar.styl
| |
| |- index.md
| '- _layout.ejs
|
|- www/ <--------------------- everything in here is generated from above
| |- index.js
| |- index.html
| '- index.css
|
|- package.json
'- readme.md
-
-
Save brianleroux/6954799 to your computer and use it in GitHub Desktop.
I think straight browserify combined with the leading _
convention would be ideal, since it follows the existing convention of using preprocessor-specific include mechanisms (Jade mixins, LESS) and is super simple to understand — just require("./_includes/my-include.js")
. Appeal to orthogonality. Also bonus that it supports NPM packages.
Oops, realized Browserify requires included modules follow the Node.js module convention of assigning a public interface to module.exports, so wouldn't work with arbitrary JS. I'm a node-ecosystem n00b :)
@sintaxi, any updates on this feature? This is by far my biggest issue with Harp at the moment. If I have to write a separate build system for concatenating my scripts then I might as well not use Harp 😦
@sintaxi ... Any updates on this?
Having the ability to concatinate JS, set bower_components
to copy only and ignore node_modules
would allow me to win any conceivable argument for using Harp instead of Grunt or Gulp.
+1
I think a manifest file would be a slightly better way to handle this as well. It's very similar in more established static site generators and is very common place in the Ruby world. Middleman has a nice implementation of this, it just uses Sprockets on the backend (https://github.com/sstephenson/sprockets)
While a "smart directory" would be very nice and may work for the majority of use cases, I've often found myself having to load my javascript files in a specific order.
All of that said, there are certainly utilities like GruntJS that can handle more specific needs so I'm sure everyone will use the tools that best suit them. Either way a step in this direction would be a nice addition.
Just my 0.02.