This repository has been archived by the owner on Feb 3, 2022. It is now read-only.
forked from chocopie/AC-check
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Gruntfile.js
59 lines (57 loc) · 1.74 KB
/
Gruntfile.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
(function () {
"use strict";
var Config = {
babel: {
options: {
sourceMap: true,
presets: ['@babel/env']
},
dist: {
files: {
'.build/check.js': 'src/check.js',
'.build/background.js' : 'src/background.js',
'.build/options.js' : 'src/options.js'
}
}
},
eslint: {
dist: ['src/background.js', 'src/options.js', 'src/check.js'],
options: {
configFile: '.eslintrc.json'
},
},
uglify: {
dist: {
files: {
'dist/check.js' : '.build/check.js',
'dist/background.js' : '.build/background.js',
'dist/options.js' : '.build/options.js'
}
}
},
copy: {
dist: {
files: [
{ expand: true, src: 'src/options.html', dest: 'dist/', flatten: true },
{ expand: true, src: 'src/options.css', dest: 'dist/', flatten: true },
{ expand: true, src: 'manifest.json', dest: 'dist/' },
{ expand: true, src: 'assets/*', dest: 'dist/' }
],
}
},
clean: ['.build'],
run: {
test: {
cmd: 'npm',
args: [
'test'
]
}
},
};
module.exports = function (grunt) {
require('load-grunt-tasks')(grunt);
grunt.initConfig(Config);
grunt.registerTask('default', ['eslint', 'babel', 'run:test', 'uglify', 'copy', 'clean']);
};
})();