Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
Drupal 8 SASS Theme
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Composer
plugin
Drupal 8 SASS Theme
Commits
cd1120bf
Commit
cd1120bf
authored
8 years ago
by
jurgenhaas
Browse files
Options
Downloads
Patches
Plain Diff
#7
Update gulpfile for new syntax in composer.json and also add JS handling
parent
ef402a1f
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
templates/gulpfile.js
+27
-9
27 additions, 9 deletions
templates/gulpfile.js
with
27 additions
and
9 deletions
templates/gulpfile.js
+
27
−
9
View file @
cd1120bf
...
...
@@ -10,6 +10,7 @@ var gulp = require('gulp'),
config
=
{
cssPath
:
'
./css
'
,
fontsPath
:
'
./fonts
'
,
jsPath
:
'
./js
'
,
sassPath
:
'
./sass
'
},
knownOptions
=
{
...
...
@@ -18,16 +19,31 @@ var gulp = require('gulp'),
},
options
=
minimist
(
process
.
argv
.
slice
(
2
),
knownOptions
);
{
%
for
package
,
font
in
bower_assets
.
fonts
%
}
// Provide fonts from {{ package }}
gulp
.
task
(
'
fonts-{{ package }}
'
,
function
()
{
return
gulp
.
src
(
'
{{ font.src }}/**.*
'
)
.
pipe
(
gulp
.
dest
(
config
.
fontsPath
+
'
/{{ font.dest }}
'
));
{
%
for
name
,
package
in
bower_assets
%
}
{
%
if
package
.
fonts
is
defined
%
}
// Provide fonts from {{ name }}
gulp
.
task
(
'
fonts-{{ name }}
'
,
function
()
{
return
gulp
.
src
(
'
{{ package.fonts.relative }}/**.*
'
)
.
pipe
(
gulp
.
dest
(
config
.
fontsPath
+
'
/{{ name }}
'
));
});
{
%
endif
%
}
{
%
endfor
%
}
// Provide fonts from all libraries
gulp
.
task
(
'
fonts
'
,
[{
%
for
package
,
font
in
bower_assets
.
fonts
%
}
'
fonts-{{ package }}
'
,
{
%
endfor
%
}]);
gulp
.
task
(
'
fonts
'
,
[{
%
for
name
,
package
in
bower_assets
%
}{
%
if
package
.
fonts
is
defined
%
}
'
fonts-{{ name }}
'
,
{
%
endif
%
}{
%
endfor
%
}]);
{
%
for
name
,
package
in
bower_assets
%
}
{
%
if
package
.
js
is
defined
%
}
// Provide JS from {{ name }}
gulp
.
task
(
'
js-{{ name }}
'
,
function
()
{
return
gulp
.
src
(
'
{{ package.js.relative }}/**.*
'
)
.
pipe
(
gulp
.
dest
(
config
.
jsPath
+
'
/{{ name }}
'
));
});
{
%
endif
%
}
{
%
endfor
%
}
// Provide JS from all libraries
gulp
.
task
(
'
js
'
,
[{
%
for
name
,
package
in
bower_assets
%
}{
%
if
package
.
js
is
defined
%
}
'
js-{{ name }}
'
,
{
%
endif
%
}{
%
endfor
%
}]);
// Pre-process CSS
gulp
.
task
(
'
css
'
,
function
()
{
...
...
@@ -37,8 +53,10 @@ gulp.task('css', function() {
outputStyle
:
gulpif
(
options
.
env
!==
'
production
'
,
'
nested
'
,
'
compressed
'
),
includePaths
:[
config
.
sassPath
,
{
%
for
sass
in
bower_assets
.
sass
%
}
'
{{ sass.src }}
'
,
{
%
for
name
,
package
in
bower_assets
%
}
{
%
if
package
.
sass
is
defined
%
}
'
{{ package.sass.relative }}
'
,
{
%
endif
%
}
{
%
endfor
%
}
]})
.
on
(
"
error
"
,
notify
.
onError
(
function
(
error
)
{
...
...
@@ -54,4 +72,4 @@ gulp.task('watch', function() {
});
// Default task: run all other tasks in the correct order
gulp
.
task
(
'
default
'
,
[
'
fonts
'
,
'
css
'
]);
gulp
.
task
(
'
default
'
,
[
'
fonts
'
,
'
js
'
,
'
css
'
]);
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment