Skip to content

Commit

Permalink
Merge pull request #13 from jr-cologne/scss-support
Browse files Browse the repository at this point in the history
Implement temporary support of scss
  • Loading branch information
jr-cologne authored Apr 5, 2019
2 parents 2fe89c7 + 7913886 commit 0c9fd53
Show file tree
Hide file tree
Showing 8 changed files with 488 additions and 470 deletions.
1 change: 1 addition & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
dist
.idea
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2018 JR Cologne
Copyright (c) 2019 JR Cologne

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This Gulp Starter Kit provides a simple way of setting up a modern web developme
Here is a list of the current features:

- Copy HTML files from `src` to `dist` directory
- Compile Sass to CSS, autoprefix, minify CSS and put it inside `dist` directory
- Compile Sass/SCSS to CSS, autoprefix, minify CSS and put it inside `dist` directory
- Compile ES6+ to ES5, concatenate JS files and minify code
- Compress and copy images into `dist` directory
- Copy dependencies specified in `package.json` from `src/node_modules` directory into `node_modules` folder inside `dist` directory
Expand All @@ -18,7 +18,6 @@ This should be installed on your computer in order to get up and running:

- [Node.js](https://nodejs.org/en/)
- [Gulp 4](https://gulpjs.com/)
- [Sass](http://sass-lang.com/)

## Dependencies
These [npm](https://www.npmjs.com/) packages are used in the Gulp Starter Kit:
Expand Down Expand Up @@ -85,6 +84,9 @@ The Gulp Starter Kit offers two different build scripts:
1. `npm run build`: This is used to build all files and run all tasks without serving a development server and watching for changes.
2. `npm start`: This is the normal development script used to build all files and run all tasks, but also to serve a development server and watch for changes.

### How can I use SCSS instead of Sass?
In case you prefer to use SCSS over Sass, you can simply create a new directory `src/assets/scss` which is where all your SCSS files have to be placed. After you have moved all your code to the new folder, just make sure to delete the `sass` directory and everything should work as expected.

### What types of images are supported?
The following types of images are currently supported:

Expand Down
8 changes: 4 additions & 4 deletions bin/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const projectFolder = process.argv[2];
* @param {string} name
* @return {boolean}
*/
const checkProjectFolder = (name) => name;
const checkProjectFolder = (name) => name.length > 0;

/**
* Initialize project
Expand Down Expand Up @@ -91,7 +91,7 @@ const installDependencies = dependencies => {

exec(
`cd ${ projectFolder } && npm i --save-dev ${ dependencies }`,
(npmErr, npmStdout, npmStderr) => {
(npmErr, npmStdout) => {
if (npmErr) {
console.error(
`Oops, something went wrong installing the dependencies:
Expand Down Expand Up @@ -140,7 +140,7 @@ const install = async (projectFolder, dependencies) => {

console.log('Installing dependencies - This might take a few minutes...');

if (! await installDependencies(dependencies)) return;
if (! await installDependencies(dependencies)) return false;

console.log('Dependency installation successful - All dependencies have been installed');

Expand All @@ -151,7 +151,7 @@ const install = async (projectFolder, dependencies) => {
console.log('Copying additional files successful');

return true;
}
};

if (!checkProjectFolder(projectFolder)) {
console.error('Oops, looks like you have not specified any project name. Please make sure to do that.');
Expand Down
10 changes: 7 additions & 3 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
*
* @package @jr-cologne/create-gulp-starter-kit
* @author JR Cologne <[email protected]>
* @copyright 2018 JR Cologne
* @copyright 2019 JR Cologne
* @license https://github.com/jr-cologne/gulp-starter-kit/blob/master/LICENSE MIT
* @version v0.4.0-alpha
* @version v0.5.0-alpha
* @link https://github.com/jr-cologne/gulp-starter-kit GitHub Repository
* @link https://www.npmjs.com/package/@jr-cologne/create-gulp-starter-kit npm package site
*
Expand Down Expand Up @@ -49,7 +49,10 @@ gulp.task('html', () => {
});

gulp.task('sass', () => {
return gulp.src([ src_assets_folder + 'sass/**/*.sass' ])
return gulp.src([
src_assets_folder + 'sass/**/*.sass',
src_assets_folder + 'scss/**/*.scss'
])
.pipe(sourcemaps.init())
.pipe(plumber())
.pipe(sass())
Expand Down Expand Up @@ -128,6 +131,7 @@ gulp.task('watch', () => {
const watch = [
src_folder + '**/*.html',
src_assets_folder + 'sass/**/*.sass',
src_assets_folder + 'scss/**/*.scss',
src_assets_folder + 'js/**/*.js'
];

Expand Down
Loading

0 comments on commit 0c9fd53

Please sign in to comment.