-
Notifications
You must be signed in to change notification settings - Fork 15
/
fusionfile.js
73 lines (63 loc) · 1.94 KB
/
fusionfile.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
/**
* Part of fusion project.
*
* @copyright Copyright (C) 2018 Asikart.
* @license MIT
*/
const fusion = require('windwalker-fusion');
// The task `main`
fusion.task('main', function () {
// Watch start
//fusion.watch('src/scss/**/*.scss');
// Watch end
// Compile Start
//fusion.sass('src/scss/**/*.scss', 'dist/app.css');
// Compile end
});
// The task `install`
fusion.task('install', function () {
const nodePath = 'node_modules';
const destPath = 'asset';
// Underscore
fusion.copy(`${nodePath}/underscore/underscore.*`, `${destPath}/js/core/`);
fusion.copy(`${nodePath}/underscore.string/dist/*`, `${destPath}/js/core/`);
// Backbone
fusion.copy(`${nodePath}/backbone/backbone.js`, `${destPath}/js/core/backbone.js`);
fusion.copy(`${nodePath}/backbone/backbone-min.js`, `${destPath}/js/core/backbone.min.js`);
// URL Polyfill
fusion.copy(`${nodePath}/url-polyfill/*.js`, `${destPath}/js/polyfill/`);
// Promise Polyfill
fusion.copy(`${nodePath}/promise-polyfill/dist/polyfill.js`, `${destPath}/js/polyfill/promise.js`);
fusion.copy(`${nodePath}/promise-polyfill/dist/polyfill.min.js`, `${destPath}/js/polyfill/promise.min.js`);
});
fusion.default(['main']);
/*
* APIs
*
* Compile entry:
* fusion.js(source, dest, options = {})
* fusion.babel(source, dest, options = {})
* fusion.ts(source, dest, options = {})
* fusion.typeScript(source, dest, options = {})
* fusion.css(source, dest, options = {})
* fusion.less(source, dest, options = {})
* fusion.sass(source, dest, options = {})
* fusion.copy(source, dest, options = {})
*
* Live Reload:
* fusion.livereload(source, dest, options = {})
* fusion.reload(file)
*
* Gulp proxy:
* fusion.src(source, options)
* fusion.dest(path, options)
* fusion.task(name, deps, fn)
* fusion.watch(glob, opt, fn)
*
* Stream Helper:
* fusion.through(handler) // Same as through2.obj()
*
* Config:
* fusion.disableNotification()
* fusion.enableNotification()
*/