forked from ableplayer/ableplayer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGruntfile.cjs
More file actions
59 lines (57 loc) · 1.46 KB
/
Gruntfile.cjs
File metadata and controls
59 lines (57 loc) · 1.46 KB
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
module.exports = function (grunt) {
grunt.loadNpmTasks("grunt-contrib-copy");
grunt.loadNpmTasks("grunt-contrib-cssmin");
grunt.loadNpmTasks("grunt-contrib-clean");
grunt.loadNpmTasks('grunt-run');
grunt.loadNpmTasks('grunt-eslint');
grunt.initConfig({
pkg: grunt.file.readJSON("package.json"),
cssmin: {
min: {
src: ["styles/ableplayer.css"],
dest: "build/<%= pkg.name %>.min.css",
},
options: {
// Add a banner with the package name and version
// (no date, otherwise a new build is different even if the code didn't change!)
// (oddly, here we don't need a '\n' at the end!)
banner: "/*! <%= pkg.name %> V<%= pkg.version %> */",
},
},
run: {
rollup: {
cmd: 'npm',
args: ['exec', 'rollup', '--', '-c'],
},
jest: {
cmd: 'npm',
args: ['exec', 'jest', '--', '--colors']
},
types: {
cmd: 'npx',
args: ['tsc']
},
},
copy: {
dompurify: {
files: {
'build/separate-dompurify/purify.min.js': ['/node_modules/dompurify/dist/purify.min.js'],
}
}
},
eslint: {
target: ['scripts/*.js'],
},
clean: {
build: ["build"],
},
});
grunt.registerTask("default", [
"run:rollup",
"run:types",
"copy:dompurify",
"cssmin",
]);
grunt.registerTask("test", ["eslint"]);
grunt.registerTask("jest", ["run:rollup", "run:jest"]);
};