This repository has been archived by the owner on Jan 27, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
75 lines (53 loc) · 1.73 KB
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
process.env.DISABLE_NOTIFIER = true;
var gulp = require('gulp');
var elixir = require('laravel-elixir');
var argv = require('yargs').argv;
var bin = require('./tasks/bin');
var httpServer = require('http-server');
var open = require('open');
require('laravel-elixir-remove');
elixir.config.assetsPath = 'source/_assets';
elixir.config.publicPath = 'source';
elixir.config.sourcemaps = false;
elixir(function(mix) {
var env = argv.e || argv.env || 'local';
var port = argv.p || argv.port || 3000;
// @imports all the other SCSS partials
mix.sass('main.scss');
// Standardize baseline styles across browsers
mix.sass('reset.scss');
// Combine all scripts into main.js
// Jigsaw will take care of copying it to build_*
mix.scripts(
[
'header.js',
'lightbox.js',
'slideshow.js',
],
'./source/js/main.js'
);
// Remove any emacs backup files
mix.remove('source/**/*~');
// Run Jigsaw
mix.exec(bin.path() + ' build ' + env, [
'./source/*',
'./source/**/*',
'!./source/_assets/**/*'
]);
// Don't run the server in production
if (env != 'production') {
// Run a simple HTTP server on `port`
var server = httpServer.createServer({
root: './build_' + env
});
server.listen(port);
// Open the site in browser
open('http://localhost:' + port);
}
// TODO: Add LiveReload?
// https://github.com/napcs/node-livereload
// For now, go download it manually:
// http://livereload.com/
// Regardless, you'll need the Chrome extension:
// https://chrome.google.com/webstore/detail/livereload/jnihajbhpnppcggbcgedagnkighmdlei
});