Skip to content

Commit 2e71b40

Browse files
author
Rob Dodson
committed
Underscore source directories.
1 parent bcdcc75 commit 2e71b40

40 files changed

+66
-18
lines changed

.eleventy.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Transforms
2-
const htmlMinTransform = require('./site/transforms/html-min-transform.js');
2+
const htmlMinTransform = require('./site/_transforms/html-min-transform.js');
33

44
// Create a helpful production flag
55
const isProduction = process.env.NODE_ENV === 'production';
@@ -11,11 +11,6 @@ module.exports = config => {
1111
// to use it for its build.
1212
config.setUseGitIgnore(false);
1313

14-
// Tell eleventy to copy our images over
15-
config.addPassthroughCopy("site/images");
16-
// Tell eleventy to copy our fonts over
17-
config.addPassthroughCopy("site/fonts");
18-
1914
// Only minify HTML if we are in production because it slows builds _right_ down
2015
if (isProduction) {
2116
config.addTransform('htmlmin', htmlMinTransform);

gulp-tasks/fonts.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
const {dest, src} = require('gulp');
2+
const fonts = () => {
3+
return src('./site/_fonts/**/*').pipe(dest('dist/fonts/'));
4+
};
5+
6+
module.exports = fonts;

gulp-tasks/images.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
const {dest, src} = require('gulp');
2+
const images = () => {
3+
return src('./site/_images/**/*').pipe(dest('dist/images/'));
4+
};
5+
6+
module.exports = images;

gulp-tasks/sass.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const calculateOutput = ({history}) => {
3333
// The main Sass method grabs all root Sass files,
3434
// processes them, then sends them to the output calculator
3535
const sass = () => {
36-
return src('./site/scss/**/*.scss')
36+
return src('./site/_scss/**/*.scss')
3737
.pipe(sassProcessor().on('error', sassProcessor.logError))
3838
.pipe(
3939
cleanCSS(

gulpfile.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,21 @@ const {parallel, watch} = require('gulp');
22

33
// Pull in each task
44
const sass = require('./gulp-tasks/sass.js');
5+
const images = require('./gulp-tasks/images.js');
6+
const fonts = require('./gulp-tasks/fonts.js');
57

68
// Set each directory and contents that we want to watch and
79
// assign the relevant task. `ignoreInitial` set to true will
810
// prevent the task being run when we run `gulp watch`, but it
911
// will run when a file changes.
1012
const watcher = () => {
11-
watch('./site/scss/**/*.scss', {ignoreInitial: true}, sass);
13+
watch('./site/_scss/**/*.scss', {ignoreInitial: true}, sass);
14+
watch('./site/_images/**/*', {ignoreInitial: true}, images);
15+
watch('./site/_fonts/**/*', {ignoreInitial: true}, fonts);
1216
};
1317

1418
// The default (if someone just runs `gulp`) is to run each task in parrallel
15-
exports.default = parallel(sass);
19+
exports.default = parallel(sass, images, fonts);
1620

1721
// This is our watcher task that instructs gulp to watch directories and
1822
// act accordingly

package-lock.json

Lines changed: 39 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "1.0.0",
44
"description": "The source for developers.chrome.com",
55
"scripts": {
6-
"clean": "rm -rf dist",
6+
"clean": "rimraf dist",
77
"dev": "npm-run-all clean gulp rollup --parallel --race gulp:watch rollup:watch eleventy:watch server",
88
"eleventy:watch": "npx eleventy --watch",
99
"eleventy": "npx eleventy",
@@ -41,6 +41,7 @@
4141
"devDependencies": {
4242
"@types/node": "^13.11.1",
4343
"gts": "^2.0.2",
44+
"rimraf": "^3.0.2",
4445
"typescript": "^3.8.3"
4546
}
4647
}

rollup.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {nodeResolve} from '@rollup/plugin-node-resolve';
66
import {terser} from 'rollup-plugin-terser';
77

88
const devConfig = {
9-
input: 'site/js/main.js',
9+
input: 'site/_js/main.js',
1010
output: {
1111
dir: 'dist/js',
1212
format: 'esm',
@@ -19,7 +19,7 @@ const devConfig = {
1919
};
2020

2121
const productionConfig = {
22-
input: 'site/js/main.js',
22+
input: 'site/_js/main.js',
2323
output: {
2424
dir: 'dist/js',
2525
format: 'esm',
File renamed without changes.

0 commit comments

Comments
 (0)