Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
vms:webdev:nodejs:riot [2015/09/14 17:41] admin |
vms:webdev:nodejs:riot [2015/09/14 18:01] admin |
||
---|---|---|---|
Line 13: | Line 13: | ||
> mkdir /path/to/dev/project | > mkdir /path/to/dev/project | ||
> cd /apth/to/dev/project | > cd /apth/to/dev/project | ||
- | > nano package.json | ||
- | PASTE: | + | > npm init |
- | { | + | > npm install riot --save |
- | "name": "hello-world", | + | > npm install babel --save-dev |
- | "version": "1.0.0", | + | |
- | "description": "riot.js Hello Word sample with npm and es6", | + | |
- | "scripts": { | + | |
- | "watch": "riot --type es6 -w app dist", | + | |
- | "compile": "riot --type es6 app dist" | + | |
- | }, | + | |
- | "keywords": [ | + | |
- | "riot.js", | + | |
- | "hello-world" | + | |
- | ], | + | |
- | "dependencies": { | + | |
- | "riot": "^2.2.3" | + | |
- | } | + | |
- | } | + | |
</code> | </code> | ||
+ | |||
+ | This should be the minimum required to allow server side compilation of your tags (that's why babel is required on the dev platform). | ||
+ | |||
+ | Some npm packages of interest for a dev environment: | ||
+ | <code> | ||
+ | > npm install browser-sync --save-dev | ||
+ | > npm install parallelshell --save-dev | ||
+ | > npm install rimraf --save-dev | ||
+ | </code> | ||
+ | |||
+ | Refer to [[https://drublic.de/blog/npm-builds/|this great article by Hans Christian Reinl]] for a good starting reference about a modern dev environment setup. |