Skip to content

Commit

Permalink
Initial
Browse files Browse the repository at this point in the history
- Migrate MO Skyrim and vs15 themes to MO2. Fix some small things.
- Update gulp tasks to support generic themes
- Update `gulp` to `^4.0.0`
  • Loading branch information
nikolay-borzov committed Oct 28, 2018
0 parents commit 8907558
Show file tree
Hide file tree
Showing 85 changed files with 8,117 additions and 0 deletions.
60 changes: 60 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Typescript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

dist
51 changes: 51 additions & 0 deletions Gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
const gulp = require('gulp')
const pump = require('pump')
const sass = require('gulp-sass')
const replace = require('gulp-replace')
const rename = require('gulp-rename')
const del = require('del')

const { theme, dest } = require('minimist')(process.argv.slice(3))

if (!theme) {
throw new Error(`'theme' parameter is required`)
}

const sassGlob = `themes/${theme}/sass/**/*.scss`
const imagesGlob = `themes/${theme}/images/*.png`
const destPath = dest || `./dist/`
const imagesDest = `${destPath}/${theme}/`

function clean() {
return del([`${imagesDest}/**`, `${destPath}/${theme}*.qss`], {
force: true
})
}

function copyImages(done) {
pump([gulp.src(imagesGlob), gulp.dest(imagesDest)], done)
}

function buildCss(done) {
pump(
[
gulp.src(sassGlob),
sass().on('error', sass.logError),
replace('/*POSTSASS ', ''),
replace(' POSTSASS*/', ''),
replace(/\nSTUB/g, ''),
rename({ extname: '.qss' }),
gulp.dest(destPath)
],
done
)
}

exports.build = gulp.series(clean, gulp.parallel(buildCss, copyImages))

exports.watch = () =>
gulp.watch(
sassGlob,
{ ignoreInitial: false },
gulp.parallel(buildCss, copyImages)
)
Loading

0 comments on commit 8907558

Please sign in to comment.