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
6beaa5ce
Commit
6beaa5ce
authored
Apr 13, 2019
by
Nikolay Gromov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Багфикс: сборка js
parent
63e7b452
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
7 deletions
+16
-7
gulpfile.js
gulpfile.js
+16
-7
No files found.
gulpfile.js
View file @
6beaa5ce
...
...
@@ -277,18 +277,27 @@ exports.compileSass = compileSass;
function
writeJsRequiresFile
(
cb
)
{
let
msg
=
`\n/*!*
${
doNotEditMsg
.
replace
(
/
\n
/gm
,
'
\
n * '
).
replace
(
/
\n\n
$/
,
'
\
n */
\
n
\
n'
)}
`
;
let
jsRequires
=
msg
+
'/* global require */
\
n
\
n'
;
const
jsRequiresList
=
[];
nth
.
config
.
addJsBefore
.
forEach
(
function
(
src
)
{
jsRequires
+=
`require('
${
src
}
');\n`
;
jsRequires
List
.
push
(
src
)
;
});
const
allBlocksWithJsFiles
=
getDirectories
(
'js'
);
const
allUsedBlocks
=
nth
.
blocksFromHtml
.
concat
(
nth
.
config
.
alwaysAddBlocks
);
allBlocksWithJsFiles
.
forEach
(
function
(
blockWithJsFile
){
if
(
allUsedBlocks
.
indexOf
(
blockWithJsFile
)
==
-
1
)
return
;
jsRequires
+=
`require('../blocks/
${
blockWithJsFile
}
/
${
blockWithJsFile
}
.js');\n`
;
allBlocksWithJsFiles
.
forEach
(
function
(
blockName
){
if
(
nth
.
config
.
alwaysAddBlocks
.
indexOf
(
blockName
)
==
-
1
)
return
;
jsRequiresList
.
push
(
`../blocks/
${
blockName
}
/
${
blockName
}
.js`
)
});
allBlocksWithJsFiles
.
forEach
(
function
(
blockName
){
let
src
=
`../blocks/
${
blockName
}
/
${
blockName
}
.js`
if
(
nth
.
blocksFromHtml
.
indexOf
(
blockName
)
==
-
1
)
return
;
if
(
jsRequiresList
.
indexOf
(
src
)
>
-
1
)
return
;
jsRequiresList
.
push
(
src
);
});
nth
.
config
.
addJsAfter
.
forEach
(
function
(
src
)
{
jsRequiresList
.
push
(
src
);
});
let
msg
=
`\n/*!*
${
doNotEditMsg
.
replace
(
/
\n
/gm
,
'
\
n * '
).
replace
(
/
\n\n
$/
,
'
\
n */
\
n
\
n'
)}
`
;
let
jsRequires
=
msg
+
'/* global require */
\
n
\
n'
;
jsRequiresList
.
forEach
(
function
(
src
)
{
jsRequires
+=
`require('
${
src
}
');\n`
;
});
jsRequires
+=
msg
;
...
...
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