Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
e1944614
Commit
e1944614
authored
Dec 08, 2015
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(grunt watch): optimized grunt watch, now only operates on changed files
parent
45c69fa6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
29 deletions
+39
-29
tasks/options/clean.js
+2
-1
tasks/options/watch.js
+37
-28
No files found.
tasks/options/clean.js
View file @
e1944614
...
...
@@ -4,6 +4,7 @@ module.exports = function(config) {
return
{
release
:
[
'<%= destDir %>'
,
'<%= tempDir %>'
,
'<%= genDir %>'
],
gen
:
[
'<%= genDir %>'
],
temp
:
[
'<%= tempDir %>'
]
temp
:
[
'<%= tempDir %>'
],
css
:
[
'<%= genDir %>/css'
]
};
};
tasks/options/watch.js
View file @
e1944614
module
.
exports
=
function
(
config
)
{
module
.
exports
=
function
(
config
,
grunt
)
{
'use strict'
;
return
{
// css: {
// files: [ '<%= srcDir %>/less#<{(||)}>#*.less' ],
// tasks: ['css'],
// options: {
// spawn: false
// }
// },
grunt
.
event
.
on
(
'watch'
,
function
(
action
,
filepath
)
{
var
newPath
;
grunt
.
log
.
writeln
(
'File Changed: '
+
filepath
);
if
(
/
(\.
html
)
$/
.
test
(
filepath
))
{
newPath
=
filepath
.
replace
(
/^public/
,
'public_gen'
);
grunt
.
log
.
writeln
(
'Copying to '
+
newPath
);
grunt
.
file
.
copy
(
filepath
,
newPath
);
}
if
(
/
(\.
js
)
$/
.
test
(
filepath
))
{
newPath
=
filepath
.
replace
(
/^public/
,
'public_gen'
);
grunt
.
log
.
writeln
(
'Copying to '
+
newPath
);
grunt
.
file
.
copy
(
filepath
,
newPath
);
grunt
.
task
.
run
(
'jshint'
);
grunt
.
task
.
run
(
'jscs'
);
}
if
(
/
(\.
less
)
$/
.
test
(
filepath
))
{
grunt
.
task
.
run
(
'clean:css'
);
grunt
.
task
.
run
(
'css'
);
}
if
(
/
(\.
ts
)
$/
.
test
(
filepath
))
{
//changes changed file source to that of the changed file
var
option
=
'typescript.build.src'
;
var
result
=
filepath
;
grunt
.
config
(
option
,
result
);
grunt
.
task
.
run
(
'typescript:build'
);
grunt
.
task
.
run
(
'tslint'
);
}
});
return
{
copy_to_gen
:
{
files
:
[
'<%= srcDir %>/**/*'
],
tasks
:
[
'clean:gen'
,
'copy:public_to_gen'
,
'css'
,
'typescript:build'
,
'jshint'
,
'jscs'
,
'tslint'
,
'karma:test'
],
tasks
:
[],
options
:
{
spawn
:
false
}
},
// typescript: {
// files: ['<%= srcDir %>/app#<{(||)}>#*.ts', '<%= srcDir %>/test#<{(||)}>#*.ts'],
// tasks: ['tslint', 'typescript:build'],
// options: {
// spawn: false
// }
// }
};
};
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment