/
Gruntfile.coffee
55 lines (51 loc) · 1.23 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
{ nodeResolve: resolve } = require('@rollup/plugin-node-resolve')
commonjs = require('@rollup/plugin-commonjs')
module.exports = (grunt) ->
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
coffee: {
compile: {
files: [
{
expand: true,
cwd: 'src/',
src: ['**/*.coffee'],
dest: 'target/',
ext: '.mjs'
}
]
}
},
rollup: {
main: {
options: {
plugins: [resolve({ browser: true, preferBuiltins: false }), commonjs()]
}
files: {
'dist/synchrodecoder.mjs': ['target/synchrodecoder.mjs']
}
}
}
terser: {
main: {
files: {
'dist/synchrodecoder.min.mjs': ['dist/synchrodecoder.mjs']
}
}
}
copy: {
publish: {
files: [
{
src: ['package.json', 'README.md']
, dest: 'dist/'
}
],
}
}
})
grunt.loadNpmTasks('grunt-contrib-coffee')
grunt.loadNpmTasks('grunt-contrib-copy')
grunt.loadNpmTasks('grunt-rollup')
grunt.loadNpmTasks('grunt-terser')
grunt.registerTask('default', ['coffee', 'rollup', 'terser', 'copy:publish'])