Split vendor and site assets
This commit is contained in:
parent
9361a4cdf9
commit
eeb532b809
|
@ -1,4 +1,4 @@
|
|||
g = require 'gulp'
|
||||
|
||||
g.task 'build', ->
|
||||
g.start 'clean', 'styles', 'scripts', 'fonts'
|
||||
g.start 'clean', 'vendor', 'styles', 'fonts'
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
g = require 'gulp'
|
||||
|
||||
g.task 'clean', ->
|
||||
g.src "{output_*,source}/assets/{css,fonts,js}", read: false
|
||||
g.src [
|
||||
'output_*/assets/css',
|
||||
'output_*/assets/fonts',
|
||||
'source/assets/css',
|
||||
'source/assets/fonts',
|
||||
'source/assets/js',
|
||||
], read: false
|
||||
.pipe g.p.clean()
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
g = require 'gulp'
|
||||
|
||||
g.task 'scripts', =>
|
||||
g.src ['vendor/bower/jquery/dist/jquery.js', 'vendor/bower/bootstrap-sass/assets/javascripts/bootstrap.js']
|
||||
.pipe g.p.plumber()
|
||||
.pipe g.p.if g.config.sourceMaps, g.p.sourcemaps.init()
|
||||
.pipe g.p.concat 'all.js'
|
||||
.pipe g.p.if g.config.production, g.p.uglify()
|
||||
.pipe g.p.if g.config.sourceMaps, g.p.sourcemaps.write('.')
|
||||
.pipe g.dest 'source/assets/js'
|
|
@ -1,11 +1,4 @@
|
|||
g = require 'gulp'
|
||||
|
||||
g.task 'styles', ->
|
||||
g.src ['vendor/bower/font-awesome/css/font-awesome.css', 'sass/styles.scss']
|
||||
.pipe g.p.plumber()
|
||||
.pipe g.p.if g.config.sourceMaps, g.p.sourcemaps.init()
|
||||
.pipe g.p.sass()
|
||||
.pipe g.p.concat 'all.css'
|
||||
.pipe g.p.if g.config.sourceMaps, g.p.sourcemaps.write('.')
|
||||
.pipe g.dest 'source/assets/css'
|
||||
.pipe g.p.if g.config.livereload, g.p.livereload()
|
||||
g.css 'sass/site.scss', 'site.css'
|
||||
|
|
15
gulp/vendor.coffee
Normal file
15
gulp/vendor.coffee
Normal file
|
@ -0,0 +1,15 @@
|
|||
g = require 'gulp'
|
||||
|
||||
g.task 'vendor', -> g.start 'vendor-styles', 'vendor-scripts'
|
||||
|
||||
g.task 'vendor-styles', ->
|
||||
g.css [
|
||||
'sass/vendor.scss',
|
||||
'vendor/bower/font-awesome/css/font-awesome.css'
|
||||
], 'vendor.css'
|
||||
|
||||
g.task 'vendor-scripts', =>
|
||||
g.js [
|
||||
'vendor/bower/jquery/dist/jquery.js',
|
||||
'vendor/bower/bootstrap-sass/assets/javascripts/bootstrap/collapse.js',
|
||||
], 'vendor.js'
|
|
@ -11,7 +11,26 @@ g.config =
|
|||
liveReload: !g.p.util.env.production
|
||||
|
||||
g.copy = (srcFiles, outputDir) ->
|
||||
g.src(srcFiles)
|
||||
.pipe g.dest(outputDir)
|
||||
g.src srcFiles
|
||||
.pipe g.dest outputDir
|
||||
|
||||
g.css = (srcFiles, destFile) ->
|
||||
g.src srcFiles
|
||||
.pipe g.p.plumber()
|
||||
.pipe g.p.if g.config.sourceMaps, g.p.sourcemaps.init()
|
||||
.pipe g.p.sass()
|
||||
.pipe g.p.concat destFile
|
||||
.pipe g.p.if g.config.sourceMaps, g.p.sourcemaps.write('.')
|
||||
.pipe g.dest 'source/assets/css'
|
||||
.pipe g.p.if g.config.livereload, g.p.livereload()
|
||||
|
||||
g.js = (srcFiles, destFile) ->
|
||||
g.src srcFiles
|
||||
.pipe g.p.plumber()
|
||||
.pipe g.p.if g.config.sourceMaps, g.p.sourcemaps.init()
|
||||
.pipe g.p.concat destFile
|
||||
.pipe g.p.if g.config.production, g.p.uglify()
|
||||
.pipe g.p.if g.config.sourceMaps, g.p.sourcemaps.write('.')
|
||||
.pipe g.dest 'source/assets/js'
|
||||
|
||||
require('fs').readdirSync('./gulp').forEach (task) -> require "./gulp/#{task}"
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
@import '_variables';
|
||||
|
||||
@import '../vendor/bower/bootstrap-sass/assets/stylesheets/bootstrap/variables';
|
||||
@import '../vendor/bower/bootstrap-sass/assets/stylesheets/bootstrap/mixins/clearfix';
|
||||
@import '../vendor/bower/compass-breakpoint/stylesheets/breakpoint';
|
||||
@import '../vendor/bower/bootstrap-sass/assets/stylesheets/bootstrap';
|
||||
|
||||
@import '_variables';
|
||||
|
||||
@import 'partials/base';
|
||||
@import 'partials/badges';
|
4
sass/vendor.scss
Normal file
4
sass/vendor.scss
Normal file
|
@ -0,0 +1,4 @@
|
|||
@import '_variables';
|
||||
|
||||
@import '../vendor/bower/compass-breakpoint/stylesheets/breakpoint';
|
||||
@import '../vendor/bower/bootstrap-sass/assets/stylesheets/bootstrap';
|
|
@ -18,7 +18,8 @@
|
|||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
<link rel="stylesheet" href="{{ site.url }}/assets/css/all.css">
|
||||
<link rel="stylesheet" href="{{ site.url }}/assets/css/vendor.css">
|
||||
<link rel="stylesheet" href="{{ site.url }}/assets/css/site.css">
|
||||
{% block styles %}{% endblock %}
|
||||
|
||||
{% for size in site.apple_touch_icon_sizes %}
|
||||
|
@ -90,7 +91,7 @@
|
|||
{% include('meetups') %}
|
||||
</footer>
|
||||
|
||||
<script src="{{ site.url }}/assets/js/all.js"></script>
|
||||
<script src="{{ site.url }}/assets/js/vendor.js"></script>
|
||||
|
||||
{% block scripts %}{% endblock %}
|
||||
|
||||
|
|
Loading…
Reference in a new issue