By request, I have made a basic demo repo for how to use Elixir without Laravel. The original post is here.
The app itself is a hash digester written in Vue.js in 71 loc, which I think is pretty neat in itself!
The gulpfile.js
has three tasks:
- Sass to CSS:
src/sass/app.scss
->dist/css/app.css
- Browserify JS:
src/js/app.js
->dist/js/app.js
- Browser Sync watches these for changes:
**/*.html
,dist/js/**/*.js
,dist/css/**/*.css
To get running:
npm install
npm start
Then localhost:3000 should automatically launch.
- You may need to open
src/sass/app.scss
and save it once for gulp to kick on and process it for the first time. - You can also run
gulp watch
instead ofnpm start
(they do the same thing)
All you need is love Node.js.
- Minimum:
0.10.13
- Recommended:
0.12.0
or above
- Update Advanced Package Tool:
sudo apt-get update
- Install Node.js:
sudo apt-get install nodejs
- Install NPM:
sudo apt-get install npm
- Create a symbolic link for node
sudo ln -s /usr/bin/nodejs /usr/bin/node
To minify for production run either npm run prod
or gulp --production
(they do the same thing).
As a final note, I added babel-preset-es2015
and babel-preset-react
to the dev dependencies.
This fixes an issue that I have sometimes:
Couldn't find preset "es2015" relative to directory