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
86ecea5c
Commit
86ecea5c
authored
Apr 08, 2019
by
Nikolay Gromov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Исправление: обязательные блоки берутся в сборку до всех прочих
parent
77919d22
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
gulpfile.js
gulpfile.js
+7
-2
No files found.
gulpfile.js
View file @
86ecea5c
...
...
@@ -46,7 +46,7 @@ const path = require('path');
const
buildLibrary
=
process
.
env
.
BUILD_LIBRARY
==
'yes'
?
true
:
false
;
const
nth
=
{};
nth
.
config
=
require
(
'./config.js'
);
nth
.
blocksFromHtml
=
nth
.
config
.
alwaysAddBlocks
;
// блоки из конфига сразу добавим в список блоков
nth
.
blocksFromHtml
=
Object
.
create
(
nth
.
config
.
alwaysAddBlocks
)
;
// блоки из конфига сразу добавим в список блоков
nth
.
scssImportsList
=
[];
// список импортов стилей
const
dir
=
nth
.
config
.
dir
;
...
...
@@ -222,10 +222,15 @@ function writeSassImportsFile(cb) {
nth
.
config
.
addStyleBefore
.
forEach
(
function
(
src
)
{
newScssImportsList
.
push
(
src
);
});
nth
.
config
.
alwaysAddBlocks
.
forEach
(
function
(
blockName
)
{
newScssImportsList
.
push
(
`
${
dir
.
blocks
}${
blockName
}
/
${
blockName
}
.scss`
);
});
let
allBlocksWithScssFiles
=
getDirectories
(
'scss'
);
allBlocksWithScssFiles
.
forEach
(
function
(
blockWithScssFile
){
let
url
=
`
${
dir
.
blocks
}${
blockWithScssFile
}
/
${
blockWithScssFile
}
.scss`
;
if
(
nth
.
blocksFromHtml
.
indexOf
(
blockWithScssFile
)
==
-
1
)
return
;
newScssImportsList
.
push
(
`
${
dir
.
blocks
}${
blockWithScssFile
}
/
${
blockWithScssFile
}
.scss`
);
if
(
newScssImportsList
.
indexOf
(
url
)
>
-
1
)
return
;
newScssImportsList
.
push
(
url
);
});
nth
.
config
.
addStyleAfter
.
forEach
(
function
(
src
)
{
newScssImportsList
.
push
(
src
);
...
...
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