Skip to content
Permalink
Browse files
Added minified CSS (#3073)
Co-authored-by: ashwinjayan <ashwinjayanam@gmail.com>
  • Loading branch information
RunDevelopment and ashwinjayan committed Oct 4, 2021
1 parent 5b7ce5e commit d63d6c0e786dc8f562743675283da8e73077b9d4
@@ -181,8 +181,9 @@

if ((!all[id].noCSS && !/\.js$/.test(filepath)) || /\.css$/.test(filepath)) {
var cssFile = filepath.replace(/(\.css)?$/, '.css');
var minCSSFile = cssFile.replace(/(?:\.css)$/, '.min.css');

info.files.minified.paths.push(cssFile);
info.files.minified.paths.push(minCSSFile);
info.files.dev.paths.push(cssFile);
}

@@ -7,6 +7,7 @@ const uglify = require('gulp-uglify');
const header = require('gulp-header');
const concat = require('gulp-concat');
const replace = require('gulp-replace');
const cleanCSS = require('gulp-clean-css');
const webfont = require('webfont').default;
const pump = require('pump');
const util = require('util');
@@ -70,6 +71,12 @@ function minifyComponents(cb) {
function minifyPlugins(cb) {
pump([src(paths.plugins), ...minifyJS(), rename({ suffix: '.min' }), dest('plugins')], cb);
}
function minifyPluginCSS(cb) {
pump([src(paths.pluginsCSS), cleanCSS(), rename({ suffix: '.min' }), dest('plugins')], cb);
}
function minifyThemes(cb) {
pump([src(paths.themes), cleanCSS(), rename({ suffix: '.min' }), dest('themes')], cb);
}
function build(cb) {
pump([src(paths.main), header(`
/* **********************************************
@@ -278,12 +285,11 @@ async function treeviewIconFont() {
}

const components = minifyComponents;
const plugins = series(languagePlugins, treeviewIconFont, minifyPlugins);

const plugins = series(languagePlugins, treeviewIconFont, minifyPlugins, minifyPluginCSS);

module.exports = {
watch: watchComponentsAndPlugins,
default: series(parallel(components, plugins, componentsJsonToJs, build), docs),
default: series(parallel(components, plugins, minifyThemes, componentsJsonToJs, build), docs),
linkify,
changes
};
@@ -4,6 +4,7 @@ module.exports = {
componentsFile: 'components.json',
componentsFileJS: 'components.js',
components: ['components/**/*.js', '!components/index.js', '!components/**/*.min.js'],
themes: ['themes/*.css', '!themes/*.min.css'],
main: [
'components/prism-core.js',
'components/prism-markup.js',
@@ -13,6 +14,7 @@ module.exports = {
'plugins/file-highlight/prism-file-highlight.js'
],
plugins: ['plugins/**/*.js', '!plugins/**/*.min.js'],
pluginsCSS: ['plugins/**/*.css', '!plugins/**/*.min.css'],
showLanguagePlugin: 'plugins/show-language/prism-show-language.js',
autoloaderPlugin: 'plugins/autoloader/prism-autoloader.js',
changelog: 'CHANGELOG.md'

Some generated files are not rendered by default. Learn more.

@@ -44,6 +44,7 @@
"eslint-plugin-jsdoc": "^32.3.0",
"eslint-plugin-regexp": "^1.2.0",
"gulp": "^4.0.2",
"gulp-clean-css": "^4.3.0",
"gulp-concat": "^2.3.4",
"gulp-header": "^2.0.7",
"gulp-jsdoc3": "^3.0.0",
@@ -0,0 +1 @@
.token a{color:inherit}

Some generated files are not rendered by default. Learn more.

Some generated files are not rendered by default. Learn more.

Some generated files are not rendered by default. Learn more.

Some generated files are not rendered by default. Learn more.

Some generated files are not rendered by default. Learn more.

Some generated files are not rendered by default. Learn more.

Some generated files are not rendered by default. Learn more.

Some generated files are not rendered by default. Learn more.

Some generated files are not rendered by default. Learn more.

0 comments on commit d63d6c0

Please sign in to comment.