Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
K
kpp
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alexandr Veselov
kpp
Commits
0c2ae022
Commit
0c2ae022
authored
Feb 05, 2018
by
Nikolay Gromov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Избавился от сегментов **/ в вотчере стилей
parent
0c42a169
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
10 deletions
+15
-10
gulpfile.js
gulpfile.js
+15
-10
No files found.
gulpfile.js
View file @
0c2ae022
...
@@ -26,7 +26,7 @@ const newer = require('gulp-newer');
...
@@ -26,7 +26,7 @@ const newer = require('gulp-newer');
let
projectConfig
=
require
(
'./projectConfig.json'
);
let
projectConfig
=
require
(
'./projectConfig.json'
);
let
dirs
=
projectConfig
.
dirs
;
let
dirs
=
projectConfig
.
dirs
;
let
lists
=
getFilesList
(
projectConfig
);
let
lists
=
getFilesList
(
projectConfig
);
console
.
log
(
lists
);
//
console.log(lists);
// Получение адреса репозитория
// Получение адреса репозитория
let
repoUrl
=
require
(
'./package.json'
).
repository
.
url
.
replace
(
/
\.
git$/g
,
''
);
let
repoUrl
=
require
(
'./package.json'
).
repository
.
url
.
replace
(
/
\.
git$/g
,
''
);
...
@@ -94,7 +94,7 @@ gulp.task('style', function () {
...
@@ -94,7 +94,7 @@ gulp.task('style', function () {
.
pipe
(
wait
(
100
))
.
pipe
(
wait
(
100
))
.
pipe
(
gulpIf
(
isDev
,
sourcemaps
.
init
()))
.
pipe
(
gulpIf
(
isDev
,
sourcemaps
.
init
()))
.
pipe
(
debug
({
title
:
"Style:"
}))
.
pipe
(
debug
({
title
:
"Style:"
}))
.
pipe
(
sass
())
.
pipe
(
sass
(
{
includePaths
:
[
__dirname
+
'/'
]}
))
.
pipe
(
postcss
(
postCssPlugins
))
.
pipe
(
postcss
(
postCssPlugins
))
.
pipe
(
insert
.
append
(
styleFileMsg
))
.
pipe
(
insert
.
append
(
styleFileMsg
))
.
pipe
(
gulpIf
(
!
isDev
,
cleanss
()))
.
pipe
(
gulpIf
(
!
isDev
,
cleanss
()))
...
@@ -425,12 +425,17 @@ gulp.task('serve', gulp.series('build', function() {
...
@@ -425,12 +425,17 @@ gulp.task('serve', gulp.series('build', function() {
open
:
false
,
open
:
false
,
});
});
gulp
.
watch
([
// Стили
dirs
.
srcPath
+
'scss/**/*.scss'
,
let
stylePaths
=
[
dirs
.
srcPath
+
dirs
.
blocksDirName
+
'/**/*.scss'
,
dirs
.
srcPath
+
'scss/style.scss'
,
projectConfig
.
addCssBefore
,
dirs
.
srcPath
+
'scss/mixins/*.scss'
,
projectConfig
.
addCssAfter
,
];
],
gulp
.
series
(
'style'
));
for
(
let
i
=
0
,
len
=
lists
.
blocksDirs
.
length
;
i
<
len
;
++
i
)
{
stylePaths
.
push
(
dirs
.
srcPath
+
lists
.
blocksDirs
[
i
]
+
'*.scss'
);
}
stylePaths
.
concat
(
projectConfig
.
addCssBefore
,
projectConfig
.
addCssAfter
);
// console.log(stylePaths);
gulp
.
watch
(
stylePaths
,
gulp
.
series
(
'style'
));
if
(
projectConfig
.
singleCompiled
.
length
)
{
if
(
projectConfig
.
singleCompiled
.
length
)
{
gulp
.
watch
(
projectConfig
.
singleCompiled
,
gulp
.
series
(
'style:single'
));
gulp
.
watch
(
projectConfig
.
singleCompiled
,
gulp
.
series
(
'style:single'
));
...
@@ -487,7 +492,7 @@ function getFilesList(config){
...
@@ -487,7 +492,7 @@ function getFilesList(config){
'js'
:
[],
'js'
:
[],
'img'
:
[],
'img'
:
[],
'pug'
:
[],
'pug'
:
[],
//
'blocksDirs': [],
'blocksDirs'
:
[],
};
};
// Обходим массив с блоками проекта
// Обходим массив с блоками проекта
...
@@ -539,7 +544,7 @@ function getFilesList(config){
...
@@ -539,7 +544,7 @@ function getFilesList(config){
res
.
img
.
push
(
config
.
dirs
.
srcPath
+
config
.
dirs
.
blocksDirName
+
'/'
+
blockName
+
'/img/*.{jpg,jpeg,gif,png,svg}'
);
res
.
img
.
push
(
config
.
dirs
.
srcPath
+
config
.
dirs
.
blocksDirName
+
'/'
+
blockName
+
'/img/*.{jpg,jpeg,gif,png,svg}'
);
// Список директорий
// Список директорий
//
res.blocksDirs.push(config.dirs.blocksDirName + '/' + blockName + '/');
res
.
blocksDirs
.
push
(
config
.
dirs
.
blocksDirName
+
'/'
+
blockName
+
'/'
);
}
}
else
{
else
{
...
...
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