mirror of
https://github.com/mdbootstrap/mdb-ui-kit.git
synced 2024-11-10 19:57:13 +03:00
refactored for a simpler gulp file with reuse of aggregates now that it is possible
This commit is contained in:
parent
194f67f0cf
commit
c03e48f023
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,6 +1,7 @@
|
|||
|
||||
# Ignore the root dist as buildcontrol will place it on it's own branch (same for gh-pages)
|
||||
/dist
|
||||
/build
|
||||
|
||||
# Ignore docs dist files
|
||||
docs/dist/**/*
|
||||
|
|
|
@ -67,7 +67,18 @@ const copyJsToDocs = new Copy(gulp, preset, {
|
|||
dest: 'docs/dist/'
|
||||
})
|
||||
|
||||
const javascripts = series(gulp,
|
||||
const copyCssToDocs = new Copy(gulp, preset, {
|
||||
task: {name: 'dist:css->docs'},
|
||||
source: {
|
||||
options: {cwd: 'dist'},
|
||||
glob: ['*.css']
|
||||
},
|
||||
dest: 'docs/dist/'
|
||||
})
|
||||
|
||||
const js = new Aggregate(gulp, 'js',
|
||||
series(gulp,
|
||||
new EsLint(gulp, preset),
|
||||
parallel(gulp,
|
||||
new RollupEs(gulp, preset, rollupConfig, {options: {dest: 'bootstrap-material-design.es.js'}}),
|
||||
new RollupUmd(gulp, preset, rollupConfig, {
|
||||
|
@ -85,62 +96,50 @@ const javascripts = series(gulp,
|
|||
),
|
||||
copyJsToDocs
|
||||
)
|
||||
)
|
||||
|
||||
let eslint = new EsLint(gulp, preset)
|
||||
let scsslint = new ScssLint(gulp, preset)
|
||||
const copyCssToDocs = new Copy(gulp, preset, {
|
||||
task: {name: 'dist:css->docs'},
|
||||
source: {
|
||||
options: {cwd: 'dist'},
|
||||
glob: ['*.css']
|
||||
},
|
||||
dest: 'docs/dist/'
|
||||
})
|
||||
|
||||
const sass = series(gulp,
|
||||
const css = new Aggregate(gulp, 'css',
|
||||
series(gulp,
|
||||
new ScssLint(gulp, preset),
|
||||
new Sass(gulp, preset),
|
||||
new CssNano(gulp, preset),
|
||||
copyCssToDocs
|
||||
)
|
||||
let linters = parallel(gulp, scsslint, eslint)
|
||||
)
|
||||
|
||||
let recipes = series(gulp,
|
||||
const defaultRecipes = new Aggregate(gulp, 'default', series(gulp,
|
||||
new Clean(gulp, preset),
|
||||
linters,
|
||||
parallel(gulp,
|
||||
sass,
|
||||
javascripts
|
||||
)
|
||||
css,
|
||||
js
|
||||
)
|
||||
))
|
||||
|
||||
new Aggregate(gulp, 'default', recipes)
|
||||
new Aggregate(gulp, 'lint', linters)
|
||||
new Aggregate(gulp, 'js', series(gulp, eslint, javascripts))
|
||||
new Aggregate(gulp, 'css', series(gulp, scsslint, sass))
|
||||
|
||||
|
||||
// load all docs tasks
|
||||
let docsDefaultRecipes = gulpDocs(gulp, {rollupConfig: rollupConfig})
|
||||
|
||||
const buildControlConfig = {
|
||||
options: { // see https://github.com/alienfast/build-control/blob/master/src/buildControl.js#L11
|
||||
//branch: 'v4-dist'
|
||||
}
|
||||
}
|
||||
// publish
|
||||
new Aggregate(gulp, 'publish',
|
||||
|
||||
|
||||
const prepRelease = series(gulp,
|
||||
series(gulp,
|
||||
new Prepublish(gulp, preset), // asserts committed
|
||||
recipes,
|
||||
docsDefaultRecipes, // this cleans docs, so we need to re-copy dist to docs in this scenario
|
||||
|
||||
defaultRecipes,
|
||||
|
||||
docsDefaultRecipes,
|
||||
|
||||
// ^^^docs:default cleans docs/dist, so we need to re-copy dist to docs in this scenario
|
||||
parallel(gulp, copyCssToDocs, copyJsToDocs),
|
||||
new Jekyll(gulp, preset, {options: {raw: 'baseurl: "/bootstrap-material-design"'}})
|
||||
)
|
||||
|
||||
new Aggregate(gulp, 'prepRelease', prepRelease)
|
||||
new Jekyll(gulp, preset, {options: {raw: 'baseurl: "/bootstrap-material-design"'}}),
|
||||
|
||||
new PublishBuild(gulp, preset, {
|
||||
npm: {
|
||||
bump: false,
|
||||
publish: false
|
||||
}
|
||||
}),
|
||||
|
||||
new Aggregate(gulp, 'publish', series(gulp,
|
||||
prepRelease,
|
||||
new PublishBuild(gulp, preset),
|
||||
new PublishGhPages(gulp, preset, {
|
||||
options: {
|
||||
remote: {
|
||||
|
@ -148,5 +147,6 @@ new Aggregate(gulp, 'publish', series(gulp,
|
|||
}
|
||||
}
|
||||
})
|
||||
))
|
||||
)
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user