Verified Commit 0ca0adb7 authored by David Haynes's avatar David Haynes 🙆
Browse files

Continue to work on the build system

- standardize locations of things
parent 7445a713
Pipeline #1569 passed with stage
in 37 seconds
/* /*
"scripts": { "scripts": {
"sass-compile": "node-sass --output-style expanded --source-map true --source-map-contents true --precision 6 ./masonstrap/masonstrap.scss ./public/assets/css/masonstrap.css",
"sass-prefix": "npx postcss ./public/assets/css/masonstrap.css --use autoprefixer -d ./public/assets/css/",
"sass-minify": "cleancss --source-map --source-map-inline-sources -o ./public/assets/css/masonstrap.min.css ./public/assets/css/masonstrap.css",
"copy-fonts": "cp -r ./node_modules/font-awesome/fonts/ ./public/assets/", "copy-fonts": "cp -r ./node_modules/font-awesome/fonts/ ./public/assets/",
"copy-js": "cp ./node_modules/jquery/dist/jquery.min.js ./public/assets/js/jquery.min.js && cp ./node_modules/jquery/dist/jquery.min.map ./public/assets/js/jquery.min.map && cp ./node_modules/bootstrap/dist/js/bootstrap.min.js ./public/assets/js/bootstrap.min.js && cp ./node_modules/popper.js/dist/umd/popper.min.js ./public/assets/js/popper.min.js && cp ./node_modules/popper.js/dist/umd/popper.min.js.map ./public/assets/js/popper.min.js.map", "copy-js": "cp ./node_modules/jquery/dist/jquery.min.js ./public/assets/js/jquery.min.js && cp ./node_modules/jquery/dist/jquery.min.map ./public/assets/js/jquery.min.map && cp ./node_modules/bootstrap/dist/js/bootstrap.min.js ./public/assets/js/bootstrap.min.js && cp ./node_modules/popper.js/dist/umd/popper.min.js ./public/assets/js/popper.min.js && cp ./node_modules/popper.js/dist/umd/popper.min.js.map ./public/assets/js/popper.min.js.map",
"build-masonstrap": "npm-run-all copy-js copy-fonts sass-compile sass-prefix sass-minify",
"sass-watch": "onchange './masonstrap/*.scss' -- npm run build-masonstrap",
"http": "http-server -r -p 8000", "http": "http-server -r -p 8000",
"start": "npm-run-all copy-js copy-fonts sass-watch",
"dev": "npm-run-all --parallel build-masonstrap start http" "dev": "npm-run-all --parallel build-masonstrap start http"
}, },
*/ */
// Gulp Imports // Gulp Imports
var gulp = require('gulp'); const gulp = require('gulp');
var sass = require('gulp-sass'); const sass = require('gulp-sass');
var sourcemaps = require('gulp-sourcemaps'); const sourcemaps = require('gulp-sourcemaps');
var postcss = require('gulp-postcss'); const postcss = require('gulp-postcss');
var autoprefixer = require('autoprefixer'); const autoprefixer = require('autoprefixer');
var uglifycss = require('gulp-uglifycss'); const uglifycss = require('gulp-uglifycss');
var rename = require("gulp-rename"); const rename = require("gulp-rename");
gulp.task('sass', function () { // Reusable directories
return gulp.src('./masonstrap/**/*.scss') const src = './src/'
.pipe(sourcemaps.init()) const dest = './dist/'
.pipe(sass().on('error', sass.logError))
.pipe(postcss([autoprefixer()])) // Compile, autoprefix, minify scss
.pipe(sourcemaps.write()) gulp.task('sass', () => gulp.src(src + '/scss/*.scss')
.pipe(gulp.dest('./public/assets/css/')) .pipe(sourcemaps.init())
.pipe(uglifycss()) .pipe(sass().on('error', sass.logError))
.pipe(rename({extname: ".min.css"})) .pipe(postcss([autoprefixer()]))
.pipe(gulp.dest('./public/assets/css/')); .pipe(sourcemaps.write())
}); .pipe(gulp.dest(dest + '/css/'))
.pipe(uglifycss())
.pipe(rename({extname: ".min.css"}))
.pipe(gulp.dest(dest + '/css/')));
gulp.task('sass:watch', function () { gulp.task('watch', () => {
gulp.watch('./masonstrap/**/*.scss', ['sass']); // Run `sass` task whenever scss files change
gulp.watch(src + '/scss/*.scss', ['sass'])
}); });
// Run all tasks
gulp.task('run', ['sass']);
gulp.task('default', ['run', 'watch'])
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment