FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
userscript/scripts/Super_preloaderPlus/Gruntfile.js at master · suchunchen/userscript · GitHub
suchunchen
userscript
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
userscript
/
scripts
/
Super_preloaderPlus
/
Gruntfile.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
63 lines (49 loc) · 1.72 KB
Breadcrumbs
userscript
/
scripts
/
Super_preloaderPlus
/
Gruntfile.js
Copy path
File metadata and controls
63 lines (49 loc) · 1.72 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
module
.
exports
=
function
(
grunt
)
{
var
concatOptions
=
{
banner
:
'(function() {\n'
,
footer
:
'\n})();'
,
separator
:
'\n\n//----------------------------------\n'
,
process
:
true
}
;
grunt
.
initConfig
(
{
pkg
:
grunt
.
file
.
readJSON
(
'package.json'
)
,
concat
:
{
dist
:
{
options
:
concatOptions
,
src
:
[
'src/meta.js'
,
'src/rule.js'
,
'src/setting.js'
,
'src/main.js'
,
'src/utils.js'
]
,
dest
:
'<%= pkg.name %>.user.js'
}
,
}
,
watch
:
{
files
:
[
'src/**/*.js'
]
,
tasks
:
[
'default'
]
}
}
)
grunt
.
registerTask
(
'split'
,
'split file'
,
function
(
)
{
grunt
.
file
.
expand
(
'src/*'
)
.
forEach
(
function
(
path
)
{
grunt
.
file
.
delete
(
path
)
;
}
)
;
var
source
=
grunt
.
file
.
read
(
'super_preloaderplus_one.user.js'
)
;
// 去除首行和尾行
source
=
source
.
replace
(
/
^
\(
f
u
n
c
t
i
o
n
\(
\)
.
*
/
,
''
)
.
replace
(
/
\}
\)
\(
\)
;
$
/
,
''
)
;
var
arr
=
source
.
split
(
/
\n
\/
\/
\-
+
/
)
;
arr
.
forEach
(
function
(
text
,
index
)
{
if
(
index
===
0
)
{
grunt
.
file
.
write
(
'src/meta.js'
,
text
)
;
}
else
{
var
match
=
text
.
match
(
/
\n
\/
\/
\s
*
(
.
*
)
/
)
;
var
name
=
match
?
match
[
1
]
:
(
'split'
+
index
+
'.js'
)
;
grunt
.
file
.
write
(
'src/'
+
name
,
text
)
;
}
}
)
;
// grunt.log.writeln();
}
)
;
grunt
.
registerTask
(
'default'
,
[
//'jshint',
'concat'
,
]
)
grunt
.
registerTask
(
'watch'
,
[
'watch'
]
)
grunt
.
loadNpmTasks
(
'grunt-contrib-concat'
)
grunt
.
loadNpmTasks
(
'grunt-contrib-watch'
)
}
Back
|
FazBrowse Home
|
New Git URL