This repository has been archived by the owner on Mar 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
gulpfile.js
114 lines (101 loc) · 2.34 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
"use strict";
var gulp = require("gulp");
var createSuperGulp = require("edm-supergulp");
var superGulp = createSuperGulp({
gulp: gulp
});
var packageJson = require("./package.json");
var jasmineConfigObject = require("./spec/support/jasmine.json");
var jsFiles = [
"./*.js",
"./src/**/*.js",
"./spec/**/*.js",
"./examples/*.js",
"!./lib/**/*"
];
var jsonFiles = [
".jshintrc",
".jscsrc",
"./package.json",
"./src/**/*.json",
"./spec/**/*.json",
"./examples/*.json"
];
var specFiles = [
"src/**/*[Ss]pec.js"
];
var sourceFiles = [
"src/**/*.js",
"!src/**/spec.js"
];
var deployFiles = [
"!./dist/examples",
"!./dist/lib",
"./dist/**/*"
];
//SVG sprite generate
// gulp.task("svg", function () {
// var svgs = gulp.src("examples/SVG/*.svg")
// .pipe(svgstore({ inlineSvg: true }));
//
// function fileContents (filePath, file) {
// return file.contents.toString();
// }
//
// return gulp.src("examples/knob.html")
// .pipe(inject(svgs, { transform: fileContents }))
// .pipe(gulp.dest("examples/"));
// });
superGulp.taskTemplates.initFrontendTasks({
packageJson: packageJson,
coverage: 70,
deployFolder: "knobjs/" + packageJson.version + "/",
jasmineConfigObject: jasmineConfigObject,
addPluginTasks: false,
files: {
js: jsFiles,
json: jsonFiles,
spec: specFiles,
source: sourceFiles,
deploy: deployFiles,
},
tasks: {
copy:{
dev: [
{files: "./node_modules/normalize.css/normalize.css", dest: "./dist/lib"},
{files: "./node_modules/knockout/build/output/knockout-latest.debug.js", dest: "./dist/lib"},
{files: "./examples/*.html", dest: "./dist/examples"},
{files: "./lib/*", dest: "./dist/lib"}
]
},
sass: {
common: [
{ files:"./src/main.scss", dest: "./dist", outputFileName: "knob.css"},
],
dev: [
{ files:"./src/main.scss", dest: "./dist/examples", outputFileName: "knob.css"},
{ files:"./examples/example.scss", dest: "./dist/examples", outputFileName: "example.css"}
]
},
js: {
common: [
{
entries: ["./src/main.js"],
minify: true,
destFolder: "./dist/",
outputFileName: "knob.js",
standaloneName: "knob"
}
],
dev: [
{
entries: ["./examples/main.js"],
destFolder: "./dist/examples/",
minify: true,
outputFileName: "main.js",
standaloneName: packageJson.name + "Example",
}
]
}
}
});