Skip to content

Commit

Permalink
fix(*): load search.js and copy styles with gulp
Browse files Browse the repository at this point in the history
  • Loading branch information
Aleksandyr committed May 25, 2021
1 parent 3c32b14 commit 0ffd62a
Show file tree
Hide file tree
Showing 19 changed files with 1,811 additions and 11,071 deletions.
38 changes: 36 additions & 2 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,24 @@ const path = require('path');
const slash = require('slash');
const ts = require('gulp-typescript');
const { series } = require('gulp');
const postcss = require('gulp-postcss');
const autoprefixer = require('autoprefixer');
const sourcemaps = require('gulp-sourcemaps');
const sass = require('gulp-sass');

const TYPEDOC_THEME = {
SRC: slash(path.join(__dirname, 'src')),
DIST: slash(path.join(__dirname, 'dist')),
STYLES: {
ENTRY: slash(path.join('assets', 'css', 'main.sass')),
OUT: slash(path.join('assets','css')),
MAPS: slash(__dirname),
CONFIG: {
outputStyle: 'compressed'
}
}
};


const typedocBuildThemeTS = () => {
return src(
Expand All @@ -26,5 +44,21 @@ const buildHelpers = () => {
module: 'commonjs',
}))
.pipe(dest(slash(path.join(__dirname, 'dist', 'helpers'))));
}
module.exports.buildTypedocTs = series(typedocBuildThemeTS, buildHelpers);
};

const typedocCopyStyles = () => {
const prefixer = postcss([autoprefixer({
overrideBrowserslist: ['last 5 versions', '> 3%'],
cascade: false,
grid: false
})]);

return src(slash(path.join(TYPEDOC_THEME.SRC, TYPEDOC_THEME.STYLES.ENTRY)))
.pipe(sourcemaps.init())
.pipe(sass.sync(TYPEDOC_THEME.STYLES.CONFIG).on('error', sass.logError))
.pipe(prefixer)
.pipe(sourcemaps.write('./'))
.pipe(dest(slash(path.join(TYPEDOC_THEME.DIST, TYPEDOC_THEME.STYLES.OUT))));
};

module.exports.buildTypedocTs = series(typedocBuildThemeTS, buildHelpers, typedocCopyStyles);
Loading

0 comments on commit 0ffd62a

Please sign in to comment.