mirror of
https://github.com/koodiklinikka/koodiklinikka.fi.git
synced 2026-03-02 02:59:12 +00:00
add information about adding 3rd party libraries
This commit is contained in:
19
README.md
19
README.md
@@ -23,6 +23,25 @@
|
||||
* npm run build
|
||||
* Builds & minifies everything
|
||||
|
||||
## Adding 3rd party libraries
|
||||
bower install jquery --save
|
||||
|
||||
Now to use jQuery in your frontend code, you'll need to add jQuery to **gulp-browserify** [config](https://github.com/deepak1556/gulp-browserify#browserify-shim). Your [compiler config](https://github.com/leonidas/gulp-project-template/blob/master/gulpfile.coffee#L16) should be something like this:
|
||||
|
||||
compileCoffee = (debug = false) ->
|
||||
config =
|
||||
debug: debug
|
||||
transform: ['coffeeify']
|
||||
shim:
|
||||
jquery:
|
||||
path: './vendor/jquery/jquery.js'
|
||||
exports: '$'
|
||||
|
||||
Now your should be able to require jQuery in your coffee files
|
||||
|
||||
$ = require 'jquery'
|
||||
|
||||
|
||||
## Development guidelines
|
||||
* **public** - directory should be dedicated only to compiled/copied files from **src** - directory.
|
||||
It should be possible to delete directory completely and after **npm start** or **npm run build** everything should be as they were before the deletation.
|
||||
|
||||
Reference in New Issue
Block a user