A gulp based project structure and compilation automation.
Install the required dependencies to run id-project with NPM.
$ npm install --save-dev id-project gulp coffee-script
Running id-project should work with very little configuration. Right now the policy is to enable all options by default.
- Put a file named
gulpfile.coffeein your project directory containing:
idProject = require "id-project"idProject
- Run the gulpfile from the commandline:
Or with debugging:
$ DEBUGGING=true gulp
This is the directory structure the default options assume:
These options assume the default directory structure (but you can change it to anything you like):
idProject = require "id-project"idProjectbrowserify:enabled: trueentryFilePath: "src/client/js/app/app.js"targetDirectoryPath: "build/client/js/app"targetFilename: "app.bundle.js"clean:enabled: truetargetDirectoryPath: targetDirectoryPathcoffee:enabled: truesourceDirectoryPath: "src"targetDirectoryPath: "build"copy:enabled: trueexcluded: "!**/*.coffee""!**/*.less"sourceDirectoryPath: "src"targetDirectoryPath: "build"documentation:enabled: truesourceDirectoryPath: "src"targetDirectoryPath: "docs"less:enabled: trueentryFilePath: "src/client/less/app.less"targetDirectoryPath: "build/client/css"livereload:enabled: trueforever:enabled: trueentryFilePath: "app.js"watchDirectoryPath: "build/server"tests:enabled: truedirectoryPath: "test"watch:enabled: truesourceDirectoryPath: "src"testDirectoryPath: "build"
Cleans the build directory.
Compiles Less files starting from an entry file to one Cascading Style Sheet file and places it in the build directory.
Copies any file that is not a CoffeeScript file or Less file and places it in the build directory.
Generates API documentation for all CoffeeScript files in the source directory. Uses the Codo system.
Runs assertion tests with the Mocha test runner.
When any file in the source directory changes, this task sends a message to the corresponding tasks, triggering another compile/copy/etc of the subject files.
Starts a LiveReload server. When a file changes that affects the browser, sends a message to the livereload server, reloading the browser.