1st request #1

Merged
dtomlinson merged 70 commits from develop into master 2020-06-04 16:46:03 +00:00
4 changed files with 2106 additions and 6 deletions
Showing only changes of commit 55f56c28c0 - Show all commits

15
blog/gulp.md Normal file
View File

@@ -0,0 +1,15 @@
# Gulp
Gulp can complement webpack by adding additional workflows to your project. Webpack can be used to package your bundles, gulp can be used to run additional things before or after the build.
<https://forestry.io/blog/gulp-and-webpack-best-of-both-worlds/>
Using node we could run our webpack command and build commands seperately in the workflow. We could use gulp to use one command to do both. We can also use gulp to build the search index of an app as part of this workflow.
## Creating a gulpfile
`yarn add gulp`
Create a `gulpfile.js` in the root of your project next to the `package.json` file.

15
blog/gulpfile.js Normal file
View File

@@ -0,0 +1,15 @@
import run from "build-lunrjs-index";
import { promise } from "readdirp";
const gulp = require("gulp");
// const webpack = require("webpack");
// const webpackConfig = require("./web")
function buildSearch(cb) {
return new promise((resolve, reject) => {
run();
resolve();
});
}
exports.build = buildSearch;

View File

@@ -1,7 +1,12 @@
{ {
"dependencies": { "dependencies": {
"gulp": "^4.0.2",
"lunr": "^2.3.8", "lunr": "^2.3.8",
"parser-front-matter": "^1.6.4", "parser-front-matter": "^1.6.4",
"readdirp": "^3.4.0" "readdirp": "^3.4.0"
} },
"scripts": {
"buildSearch": "gulp buildSearch"
},
"type": "module"
} }

File diff suppressed because it is too large Load Diff