Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Ignore NPM dependencies
node_modules/
package-lock.json

# Ignore build process output
dist/
60 changes: 60 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/**
* The Gulpfile is the file that tells the task runner, Gulp, what to do.
*
* The file is split up into a series of tasks. The task named 'default' will
* be executed when the command 'gulp' is run on the command line. The NPM
* script 'build' (defined in package.json) will run gulp to build the project.
*
* Gulp.js: https://gulpjs.com/
*/

const gulp = require("gulp")
const del = require("del")
const postcss = require("gulp-postcss")

/**
* Removes any previous builds from the distribution directory.
*/
gulp.task('clean', async done => {
await del("./dist/")
done()
})

/**
* Copies legacy pre-built CSS files from older versions of the codebase
* directly to the distribution directory.
*/
gulp.task('legacy', () => {
return gulp.src("./legacy/*.css").pipe(gulp.dest("./dist/css/min/"))
})

/**
* Takes CSS files, minifies them, and outputs them to dist/.
*
* This task uses PostCSS, which is a CSS plugin that can be configured to do
* many different things. PostCSS is configured in postcss.config.js.
*
* PostCSS: https://postcss.org/
* PostCSS plugins: https://www.postcss.parts/
*/
gulp.task('css', () => {
return gulp
.src("./src/**/*.css")
.pipe(postcss())
.pipe(gulp.dest("./dist/"))
})

/**
* Copies other files from src/ to dist/, which makes them available for
* deployment.
*/
gulp.task('files', () => {
return gulp
.src(["./src/**/*", "!./src/**/*.css"])
.pipe(gulp.dest("./dist/"))
})

/**
* Runs all tasks in order.
*/
gulp.task('default', gulp.series('clean', 'files', 'legacy', 'css'))
12 changes: 12 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "common-theme",
"scripts": {
"build": "gulp"
},
"devDependencies": {
"del": "^6.0.0",
"gulp": "^4.0.2",
"gulp-postcss": "^9.0.0",
"postcss": "^8.2.4"
}
}
6 changes: 6 additions & 0 deletions postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* PostCSS configuration
*/
module.exports = {
plugins: []
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes