Ответ 1
Я могу посоветовать начать с просто бранч. Бранч проще, чем хрюкать, потому что его плагины работают разумно из коробки, без необходимости писать 500 строк кода-gruntfiles. Это также намного быстрее, перекомпиляция вашего приложения будет выполнена мгновенно.
Ваша установка будет выглядеть следующим образом
public/ # The directory with static files which is generated by brunch.
app.js # Ready to be served via webserver.
app.css # Don’t change it directly, just run `brunch watch --server`.
assets/ # And then all changed files in your app dir will be compiled.
images/
frontend/ # Main brunch application directory. Configurable, of course.
app/ # Your code will reside here.
assets/ # Static files that shall not be compiled
images/ # will be just copied to `public` dir.
views/ # Create any subdirectories inside `app` dir.
file-1.js # JS files will be automatically concatenated to one file.
file-2.js # They will be also usable as modules, like require('file-2').
file-1.css # CSS files will be automatically concatenated to one file.
stuff.css # JS and CSS files may be linted before concatenation.
tpl.jade # You may have pre-compiled to JS templates. Also with `require`.
vendor/ # All third-party libraries should be put here. JS, CSS, anything.
scripts/ # They will be included BEFORE your scripts automatically.
backbone.js
underscore.js
package.json # Contains all brunch plugins, like jshint-brunch, css-brunch.
config.coffee # All params (you can concat to 2, 5, 10 files etc.)
# are set via this config. Just simple, 15 lines-of-code config.
Чтобы создать новое приложение, взгляните на скелеты бранча, которые похожи на базовые шаблоны. Выберите любой, затем используйте brunch new --skeleton <url>
, запускайте бранд-наблюдателя с brunch watch --server
и вы готовы. Когда вы захотите развернуть свое приложение, просто создайте материал с помощью brunch build --optimize
, который автоматически уменьшит файлы.