-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
93 lines (89 loc) · 2.21 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
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
module.exports = function(grunt) {
// Configuration
grunt.initConfig({
'dart-sass': {
target: {
options: {
sourceMap: false,
},
files: {
'src/static/css/mycryptocheckout.css': 'src/static/css/scss/mycryptocheckout.scss',
}
}
},
postcss: {
options: {
processors: [
require('autoprefixer')({
overrideBrowserslist: ['> 0.5%, last 2 versions, Firefox ESR, not dead']
})
]
},
dist: {
src: 'src/static/css/mycryptocheckout.css'
}
},
copy: {
main: {
files: [
// copies web3.js file
{
expand: true,
flatten: true,
src: ['node_modules/web3/dist/web3.min.js'],
dest: 'src/static/js/',
filter: 'isFile'
},
// copies bignumber.js file
{
expand: true,
flatten: true,
src: ['node_modules/bignumber.js/bignumber.js'],
dest: 'src/static/js/js.d/',
filter: 'isFile',
// Rename the file to include '40.' prefix
rename: function (dest, matchedSrcPath) {
if (matchedSrcPath.substring(0, 1) !== '4') {
return dest + '40.' + matchedSrcPath;
}
}
},
// copies clipboard.js file
{
expand: true,
flatten: true,
src: ['node_modules/clipboard/dist/clipboard.js'],
dest: 'src/static/js/js.d/',
filter: 'isFile',
// Rename the file to include '40.' prefix
rename: function (dest, matchedSrcPath) {
if (matchedSrcPath.substring(0, 1) !== '4') {
return dest + '40.' + matchedSrcPath;
}
}
},
// copies qrcode.js file
{
expand: true,
flatten: true,
src: ['node_modules/qrcode/build/qrcode.js'],
dest: 'src/static/js/js.d/',
filter: 'isFile',
// Rename the file to include '40.' prefix
rename: function (dest, matchedSrcPath) {
if (matchedSrcPath.substring(0, 1) !== '4') {
return dest + '40.' + matchedSrcPath;
}
}
},
],
},
},
});
// Load plugins
grunt.loadNpmTasks('grunt-dart-sass');
grunt.loadNpmTasks('@lodder/grunt-postcss');
grunt.loadNpmTasks('grunt-contrib-copy');
// Run All Tasks
grunt.registerTask('all', ['dart-sass', 'postcss', 'copy']);
};