-
Notifications
You must be signed in to change notification settings - Fork 215
/
Gruntfile.coffee
58 lines (49 loc) · 1.28 KB
/
Gruntfile.coffee
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
module.exports = (grunt) ->
require('load-grunt-tasks') grunt
grunt.file.readJSON('package.json')
VENDOR_PATH = 'node_modules/comment-core-library/dist'
VENDOR_FILES = [
'CommentCoreLibrary.min.js'
]
CORE_JS_FILES = [
'src/DetectMobile.js'
'src/CommentLoader.js'
'src/Player.js'
]
grunt.initConfig(
clean:
dist: ['dist']
concat:
default:
files:
'dist/ABPlayerHTML5.js': CORE_JS_FILES
# Copy
copy:
default:
files:[
{expand: true, cwd:"src/css/", src:['*'], dest:'dist/css/'}
{expand: true, cwd: VENDOR_PATH , src: VENDOR_FILES, dest:'dist/vendor/'}
]
# Auto-prefix CSS properties using Can I Use?
postcss:
options:
processors: [
require('autoprefixer')
]
dist:
# File to output
src: 'dist/css/*.css'
# Minify CSS
cssmin:
minify:
src: ['dist/css/base.css']
dest: 'dist/css/base.min.css'
uglify:
all:
files:
'dist/ABPlayerHTML5.min.js': ['dist/ABPlayerHTML5.js']
)
grunt.loadNpmTasks 'grunt-postcss'
# Register our tasks
grunt.registerTask 'dist', ['clean', 'concat', 'copy', 'uglify', 'postcss', 'cssmin']
grunt.registerTask 'default', ['dist']