├── .editorconfig ├── .github └── workflows │ └── ci.yml ├── .gitignore ├── .netlify └── state.json ├── .vscode └── settings.json ├── example ├── build.sh └── index.html ├── manifest.yml ├── netlify.toml ├── package.json ├── prettier.config.js ├── readme.md ├── renovate.json ├── src └── index.ts ├── tsconfig.json └── yarn.lock /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = tab 5 | indent_size = 2 6 | end_of_line = lf 7 | charset = utf-8 8 | trim_trailing_whitespace = true 9 | insert_final_newline = true 10 | 11 | [*.{y,ya}ml] 12 | indent_style = space 13 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: [push, pull_request] 4 | 5 | jobs: 6 | build: 7 | name: Build 8 | 9 | runs-on: ubuntu-latest 10 | 11 | steps: 12 | - name: Checkout git repository 13 | uses: actions/checkout@v2 14 | - name: Get yarn cache directory path 15 | id: yarn-cache-dir-path 16 | run: echo "::set-output name=dir::$(yarn cache dir)" 17 | - name: Cache dependencies 18 | uses: actions/cache@v2 19 | id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) 20 | with: 21 | path: ${{ steps.yarn-cache-dir-path.outputs.dir }} 22 | key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} 23 | restore-keys: | 24 | ${{ runner.os }}-yarn- 25 | - name: Install dependencies with Yarn 26 | run: yarn install 27 | - name: Compile TypeScript 28 | run: yarn run build 29 | - name: Upload compiler output 30 | uses: actions/upload-artifact@main 31 | with: 32 | name: tsc_output 33 | path: ./tsc_output 34 | lint: 35 | name: Lint 36 | 37 | runs-on: ubuntu-latest 38 | 39 | steps: 40 | - name: Checkout git repository 41 | uses: actions/checkout@v2 42 | - name: Get yarn cache directory path 43 | id: yarn-cache-dir-path 44 | run: echo "::set-output name=dir::$(yarn cache dir)" 45 | - name: Cache dependencies 46 | uses: actions/cache@v2 47 | id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) 48 | with: 49 | path: ${{ steps.yarn-cache-dir-path.outputs.dir }} 50 | key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} 51 | restore-keys: | 52 | ${{ runner.os }}-yarn- 53 | - name: Install dependencies with Yarn 54 | run: yarn install 55 | - name: Lint 56 | run: yarn run lint 57 | e2e-local: 58 | name: Local end-to-end test 59 | 60 | runs-on: ubuntu-latest 61 | 62 | steps: 63 | - name: Checkout git repository 64 | uses: actions/checkout@v2 65 | - name: Get yarn cache directory path 66 | id: yarn-cache-dir-path 67 | run: echo "::set-output name=dir::$(yarn cache dir)" 68 | - name: Cache dependencies 69 | uses: actions/cache@v2 70 | id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) 71 | with: 72 | path: ${{ steps.yarn-cache-dir-path.outputs.dir }} 73 | key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} 74 | restore-keys: | 75 | ${{ runner.os }}-yarn- 76 | - name: Install dependencies with Yarn 77 | run: yarn install 78 | # Netlify uses the npm version of the plugin, so we replace it with our version 79 | - name: Prepare for local testing 80 | run: yarn link 81 | - name: Compile TypeScript 82 | run: yarn run build 83 | - name: Use built version instead of published version 84 | run: yarn link "netlify-plugin-cache-nextjs" 85 | - name: Run local Netlify build 86 | run: yarn run e2e:local 87 | env: 88 | NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} 89 | style: 90 | name: Check style 91 | 92 | runs-on: ubuntu-latest 93 | 94 | steps: 95 | - name: Checkout git repository 96 | uses: actions/checkout@v2 97 | - name: Get yarn cache directory path 98 | id: yarn-cache-dir-path 99 | run: echo "::set-output name=dir::$(yarn cache dir)" 100 | - name: Cache dependencies 101 | uses: actions/cache@v2 102 | id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) 103 | with: 104 | path: ${{ steps.yarn-cache-dir-path.outputs.dir }} 105 | key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} 106 | restore-keys: | 107 | ${{ runner.os }}-yarn- 108 | - name: Install dependencies with Yarn 109 | run: yarn install 110 | - name: Check style with Prettier 111 | run: yarn run style 112 | publish: 113 | name: Publish 114 | 115 | runs-on: ubuntu-latest 116 | 117 | needs: [lint, style, e2e-local] 118 | 119 | if: ${{ github.ref == 'refs/heads/master' }} 120 | 121 | steps: 122 | - name: Checkout git repository 123 | uses: actions/checkout@v2 124 | - name: Get yarn cache directory path 125 | id: yarn-cache-dir-path 126 | run: echo "::set-output name=dir::$(yarn cache dir)" 127 | - name: Cache dependencies 128 | uses: actions/cache@v2 129 | id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) 130 | with: 131 | path: ${{ steps.yarn-cache-dir-path.outputs.dir }} 132 | key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} 133 | restore-keys: | 134 | ${{ runner.os }}-yarn- 135 | - name: Install dependencies with Yarn 136 | run: yarn install 137 | - name: Compile TypeScript for publishing 138 | run: yarn run build 139 | - name: Run semantic release 140 | run: yarn run semantic-release 141 | env: 142 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 143 | NPM_TOKEN: ${{ secrets.NPM_TOKEN }} 144 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # Created by https://www.gitignore.io/api/node,linux,macos,windows,visualstudiocode 3 | # Edit at https://www.gitignore.io/?templates=node,linux,macos,windows,visualstudiocode 4 | 5 | ### Linux ### 6 | *~ 7 | 8 | # temporary files which can be created if a process still has a handle open of a deleted file 9 | .fuse_hidden* 10 | 11 | # KDE directory preferences 12 | .directory 13 | 14 | # Linux trash folder which might appear on any partition or disk 15 | .Trash-* 16 | 17 | # .nfs files are created when an open file is removed but is still being accessed 18 | .nfs* 19 | 20 | ### macOS ### 21 | # General 22 | .DS_Store 23 | .AppleDouble 24 | .LSOverride 25 | 26 | # Icon must end with two \r 27 | Icon 28 | 29 | # Thumbnails 30 | ._* 31 | 32 | # Files that might appear in the root of a volume 33 | .DocumentRevisions-V100 34 | .fseventsd 35 | .Spotlight-V100 36 | .TemporaryItems 37 | .Trashes 38 | .VolumeIcon.icns 39 | .com.apple.timemachine.donotpresent 40 | 41 | # Directories potentially created on remote AFP share 42 | .AppleDB 43 | .AppleDesktop 44 | Network Trash Folder 45 | Temporary Items 46 | .apdisk 47 | 48 | ### Node ### 49 | # Logs 50 | logs 51 | *.log 52 | npm-debug.log* 53 | yarn-debug.log* 54 | yarn-error.log* 55 | lerna-debug.log* 56 | 57 | # Diagnostic reports (https://nodejs.org/api/report.html) 58 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 59 | 60 | # Runtime data 61 | pids 62 | *.pid 63 | *.seed 64 | *.pid.lock 65 | 66 | # Directory for instrumented libs generated by jscoverage/JSCover 67 | lib-cov 68 | 69 | # Coverage directory used by tools like istanbul 70 | coverage 71 | *.lcov 72 | 73 | # nyc test coverage 74 | .nyc_output 75 | 76 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 77 | .grunt 78 | 79 | # Bower dependency directory (https://bower.io/) 80 | bower_components 81 | 82 | # node-waf configuration 83 | .lock-wscript 84 | 85 | # Compiled binary addons (https://nodejs.org/api/addons.html) 86 | build/Release 87 | 88 | # Dependency directories 89 | node_modules/ 90 | jspm_packages/ 91 | 92 | # TypeScript v1 declaration files 93 | typings/ 94 | 95 | # TypeScript cache 96 | *.tsbuildinfo 97 | 98 | # Optional npm cache directory 99 | .npm 100 | 101 | # Optional eslint cache 102 | .eslintcache 103 | 104 | # Optional REPL history 105 | .node_repl_history 106 | 107 | # Output of 'npm pack' 108 | *.tgz 109 | 110 | # Yarn Integrity file 111 | .yarn-integrity 112 | 113 | # dotenv environment variables file 114 | .env 115 | .env.test 116 | 117 | # parcel-bundler cache (https://parceljs.org/) 118 | .cache 119 | 120 | # next.js build output 121 | .next 122 | 123 | # nuxt.js build output 124 | .nuxt 125 | 126 | # react / gatsby 127 | public/ 128 | 129 | # vuepress build output 130 | .vuepress/dist 131 | 132 | # Serverless directories 133 | .serverless/ 134 | 135 | # FuseBox cache 136 | .fusebox/ 137 | 138 | # DynamoDB Local files 139 | .dynamodb/ 140 | 141 | ### VisualStudioCode ### 142 | .vscode/* 143 | !.vscode/settings.json 144 | !.vscode/tasks.json 145 | !.vscode/launch.json 146 | !.vscode/extensions.json 147 | 148 | ### VisualStudioCode Patch ### 149 | # Ignore all local history of files 150 | .history 151 | 152 | ### Windows ### 153 | # Windows thumbnail cache files 154 | Thumbs.db 155 | Thumbs.db:encryptable 156 | ehthumbs.db 157 | ehthumbs_vista.db 158 | 159 | # Dump file 160 | *.stackdump 161 | 162 | # Folder config file 163 | [Dd]esktop.ini 164 | 165 | # Recycle Bin used on file shares 166 | $RECYCLE.BIN/ 167 | 168 | # Windows Installer files 169 | *.cab 170 | *.msi 171 | *.msix 172 | *.msm 173 | *.msp 174 | 175 | # Windows shortcuts 176 | *.lnk 177 | 178 | # End of https://www.gitignore.io/api/node,linux,macos,windows,visualstudiocode 179 | 180 | # TypeScript compiler output 181 | dist 182 | 183 | # Local Netlify folder 184 | .netlify/cache* 185 | -------------------------------------------------------------------------------- /.netlify/state.json: -------------------------------------------------------------------------------- 1 | { 2 | "siteId": "04d9152b-9e48-4965-af0c-387e90665d63" 3 | } 4 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "typescript.tsdk": "node_modules/typescript/lib" 3 | } 4 | -------------------------------------------------------------------------------- /example/build.sh: -------------------------------------------------------------------------------- 1 | now=$(date +"%T") 2 | currentDate=$(date +"%a") 3 | path=".next/cache/$currentDate.txt" 4 | 5 | mkdir -p .next/cache 6 | 7 | rm -f $path 8 | 9 | echo $now >> $path 10 | -------------------------------------------------------------------------------- /example/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Example page 7 | 8 | 9 | 10 |

hello

11 | 12 | 13 | -------------------------------------------------------------------------------- /manifest.yml: -------------------------------------------------------------------------------- 1 | name: netlify-plugin-cache-nextjs 2 | inputs: 3 | - name: build_dir_path 4 | description: The directory the build folder is in 5 | default: '.' 6 | - name: custom_build_dir_name 7 | description: The name of the build folder 8 | default: '.next' 9 | -------------------------------------------------------------------------------- /netlify.toml: -------------------------------------------------------------------------------- 1 | [build] 2 | base = "./example" 3 | publish = "./example" 4 | command = "bash build.sh" 5 | 6 | # Cache Next.js build folder between Netlify builds 7 | [[plugins]] 8 | package = "netlify-plugin-cache-nextjs" 9 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": { 3 | "email": "jonah@jonah.pw", 4 | "name": "Jonah Snider", 5 | "url": "https://jonah.pw" 6 | }, 7 | "bugs": { 8 | "url": "https://github.com/jonahsnider/netlify-cache-nextjs/issues" 9 | }, 10 | "dependencies": { 11 | "@netlify/cache-utils": "2.0.4" 12 | }, 13 | "devDependencies": { 14 | "eslint-plugin-prettier": "4.0.0", 15 | "netlify-cli": "8.0.10", 16 | "prettier": "2.5.0", 17 | "prettier-config-xo": "2.0.0", 18 | "semantic-release": "18.0.1", 19 | "tsdx": "0.14.1", 20 | "tslib": "2.3.1", 21 | "typescript": "4.5.2" 22 | }, 23 | "engines": { 24 | "node": ">=8.3.0" 25 | }, 26 | "files": [ 27 | "dist", 28 | "src", 29 | "manifest.yml" 30 | ], 31 | "keywords": [ 32 | "netlify", 33 | "netlify-plugin", 34 | "next.js", 35 | "nextjs" 36 | ], 37 | "license": "Apache-2.0", 38 | "main": "dist/index.js", 39 | "module": "dist/netlify-cache-nextjs.esm.js", 40 | "name": "netlify-plugin-cache-nextjs", 41 | "repository": { 42 | "type": "git", 43 | "url": "git+https://github.com/jonahsnider/netlify-cache-nextjs.git" 44 | }, 45 | "scripts": { 46 | "build": "tsdx build", 47 | "e2e:local": "netlify build", 48 | "lint": "tsdx lint", 49 | "style": "prettier --ignore-path .gitignore --check ." 50 | }, 51 | "typings": "dist/index.d.ts", 52 | "version": "0.0.0-development", 53 | "xo": { 54 | "prettier": true 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /prettier.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | ...require('prettier-config-xo'), 3 | printWidth: 160, 4 | }; 5 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # ⚠️ DEPRECATED ⚠️ 2 | 3 | This plugin is no longer maintained. 4 | 5 | Please use [Netlify's official build plugin for Next.js](https://github.com/netlify/netlify-plugin-nextjs) for the same caching functionality. 6 | 7 | # [Netlify Next.js cache](https://app.netlify.com/plugins/netlify-plugin-cache-nextjs/install) 8 | 9 | Cache the Next.js build folder in Netlify builds. 10 | 11 | [![add to netlify](https://img.shields.io/badge/add%20to-netlify-00AD9F)](https://app.netlify.com/plugins/netlify-plugin-cache-nextjs/install) 12 | [![npm](https://img.shields.io/npm/v/netlify-plugin-cache-nextjs)](https://www.npmjs.com/package/netlify-plugin-cache-nextjs) 13 | [![downloads per week](https://img.shields.io/npm/dw/netlify-plugin-cache-nextjs)](https://www.npmjs.com/package/netlify-plugin-cache-nextjs) 14 | [![Build Status](https://github.com/jonahsnider/netlify-cache-nextjs/workflows/CI/badge.svg)](https://github.com/jonahsnider/netlify-cache-nextjs/actions) 15 | [![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/xojs/xo) 16 | 17 | A [popular](https://www.netlify.com/blog/2020/06/22/top-10-netlify-build-plugins/#4-next-js-cache) [Netlify build plugin](https://docs.netlify.com/configure-builds/build-plugins/). 18 | 19 | ## Usage 20 | 21 | This is a Netlify build plugin, which will run during your Netlify builds. You can learn more about Netlify Build Plugins in the [Netlify docs](https://docs.netlify.com/configure-builds/build-plugins/). 22 | 23 | [![add to netlify](https://img.shields.io/badge/add%20to-netlify-00AD9F)](https://app.netlify.com/plugins/netlify-plugin-cache-nextjs/install) 24 | 25 | If you want to manually install the plugin add the following lines to your `netlify.toml` file: 26 | 27 | ```toml 28 | [[plugins]] 29 | package = "netlify-plugin-cache-nextjs" 30 | ``` 31 | 32 | Next, from your project's base directory, use yarn, npm, or any other Node.js package manager to add this plugin to devDependencies in `package.json`. 33 | 34 | ```sh 35 | yarn add -D netlify-plugin-cache-nextjs 36 | ``` 37 | 38 | If you want to configure the plugin, you can do this in your `netlify.toml` file: 39 | 40 | ```toml 41 | [[plugins]] 42 | package = "netlify-plugin-cache-nextjs" 43 | # These options will cache the build directory at `${NETLIFY_BASE}/frontend/.next-build` 44 | [plugins.inputs] 45 | # The path to the build directory 46 | build_dir_path = "frontend" 47 | # Custom build directory if you aren't using `.next` (https://nextjs.org/docs/api-reference/next.config.js/setting-a-custom-build-directory) 48 | custom_build_dir_name = ".next-build" 49 | ``` 50 | 51 | Note: The `[[plugins]]` line is required for each plugin, even if you have other plugins in your `netlify.toml` file already. 52 | 53 | ## Contributing 54 | 55 | ### Prequisites 56 | 57 | This project uses any [Node.js](https://nodejs.org) version Netlify supports (8-13). 58 | For best results use the latest Node.js LTS version. 59 | 60 | This project uses [Yarn](https://yarnpkg.com) to install dependencies, although you can use another package manager like [npm](https://www.npmjs.com) or [pnpm](https://pnpm.js.org). 61 | 62 | ```sh 63 | yarn install 64 | # or `npm install` 65 | # or `pnpm install` 66 | ``` 67 | 68 | ### Building 69 | 70 | Run the `build` script to compile and optimize the TypeScript code into the `dist` folder. 71 | 72 | ### Style 73 | 74 | This project uses [Prettier](https://prettier.io) and [XO](https://github.com/xojs/xo). 75 | 76 | You can run Prettier in the project with this command: 77 | 78 | ```sh 79 | yarn run style 80 | ``` 81 | 82 | You can run XO with this command: 83 | 84 | ```sh 85 | yarn run lint 86 | ``` 87 | 88 | Note that XO will also error if you have TypeScript errors, not just if your formatting is incorrect. 89 | 90 | ### Linting 91 | 92 | This project uses [XO](https://github.com/xojs/xo) (which uses [ESLint](https://eslint.org) and some plugins internally) to perform static analysis on the TypeScript. 93 | It reports things like unused variables or not following code conventions. 94 | 95 | ```sh 96 | yarn run lint 97 | ``` 98 | 99 | Note that XO will also error if you have incorrect formatting, not just if your TypeScript code has errors. 100 | -------------------------------------------------------------------------------- /renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://docs.renovatebot.com/renovate-schema.json", 3 | "extends": ["@jonahsnider"] 4 | } 5 | -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- 1 | import {existsSync} from 'fs'; 2 | import {join as joinPaths} from 'path'; 3 | 4 | interface NetlifyUtils { 5 | cache: { 6 | restore: (path: string, options?: Partial<{cwd: string}>) => Promise; 7 | save: (path: string, options?: Partial<{digests: string[]; cwd: string; ttl: number}>) => Promise; 8 | }; 9 | build: { 10 | failBuild: (message: string) => unknown; 11 | failPlugin: (message: string) => unknown; 12 | cancelBuild: (message: string) => unknown; 13 | }; 14 | status: { 15 | /** @see https://docs.netlify.com/configure-builds/build-plugins/create-plugins/#logging */ 16 | show: (status: {title?: string; summary: string; text?: string}) => unknown; 17 | }; 18 | } 19 | 20 | interface NetlifyInputs { 21 | // The TOML config uses snakecase for readability and because it's convention 22 | custom_build_dir_name: string; 23 | build_dir_path: string; 24 | } 25 | 26 | interface NetlifyOpts { 27 | utils: NetlifyUtils; 28 | netlifyConfig: {build: {base: string}}; 29 | inputs: NetlifyInputs; 30 | } 31 | 32 | function generateAbsolutePaths(options: Pick): { 33 | absolute: { 34 | /** The absolute path to the build folder for Next.js. */ 35 | buildDir: string; 36 | /** The absolute path to the build manifest Next.js uses. */ 37 | manifest: string; 38 | }; 39 | /** The name of the build directory. */ 40 | buildDirName: string; 41 | } { 42 | /** The name of the build folder. `.next`, unless specially configured. */ 43 | const buildDirName = options.inputs.custom_build_dir_name; 44 | /** The directory the build folder is in. Defaults to current directory, although some larger repositories might keep this in a `frontend` folder. */ 45 | const buildDirPathFromProject = options.inputs.build_dir_path; 46 | 47 | /** The absolute path to the build folder for Next.js. */ 48 | const absoluteBuildDirPath = joinPaths(buildDirPathFromProject, buildDirName, 'cache'); 49 | /** The absolute path to the build manifest Next.js uses. */ 50 | // I don't actually know if this build manifest has any relation to the cache folder 51 | const manifestPath = joinPaths(absoluteBuildDirPath, '..', 'build-manifest.json'); 52 | 53 | return { 54 | absolute: { 55 | buildDir: absoluteBuildDirPath, 56 | manifest: manifestPath, 57 | }, 58 | buildDirName, 59 | }; 60 | } 61 | 62 | module.exports = { 63 | // Restore file/directory cached in previous builds. 64 | // Does not do anything if: 65 | // - the file/directory already exists locally 66 | // - the file/directory has not been cached yet 67 | async onPreBuild({utils, inputs}: NetlifyOpts) { 68 | const paths = generateAbsolutePaths({inputs}); 69 | const success = await utils.cache.restore(paths.absolute.buildDir); 70 | 71 | console.log(`${paths.absolute.buildDir} ${existsSync(paths.absolute.buildDir) ? 'exists' : 'does not exist'} on disk`); 72 | 73 | if (success) { 74 | const message = `Restored the cached ${paths.buildDirName} folder at the location ${paths.absolute.buildDir}`; 75 | 76 | console.log(message); 77 | utils.status.show({summary: `Restored the ${paths.buildDirName} folder`, text: message}); 78 | } else { 79 | console.error(`Couldn't restore the cache for the ${paths.buildDirName} folder at the location ${paths.absolute.buildDir}`); 80 | } 81 | }, 82 | // Cache file/directory for future builds. 83 | // Does not do anything if: 84 | // - the file/directory does not exist locally 85 | // - the file/directory is already cached and its contents has not changed 86 | // If this is a directory, this includes children's contents 87 | // Note that this will cache after the build, even if it fails, which fcould be unwanted behavior 88 | async onPostBuild({utils, inputs}: NetlifyOpts) { 89 | const paths = generateAbsolutePaths({inputs}); 90 | 91 | console.log(`${paths.absolute.buildDir} ${existsSync(paths.absolute.buildDir) ? 'exists' : 'does not exist'} on disk`); 92 | 93 | const success = await utils.cache.save(paths.absolute.buildDir, { 94 | digests: [paths.absolute.manifest], 95 | }); 96 | 97 | if (success) { 98 | const message = `Cached the ${paths.buildDirName} folder at the location ${paths.absolute.buildDir}`; 99 | 100 | console.log(message); 101 | utils.status.show({summary: `Saved the ${paths.buildDirName} folder`, text: message}); 102 | } else { 103 | console.error(`Couldn't cache the ${paths.buildDirName} folder at the location ${paths.absolute.buildDir}`); 104 | } 105 | }, 106 | }; 107 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "declaration": true, 4 | "esModuleInterop": true, 5 | "importHelpers": true, 6 | "lib": ["dom", "esnext"], 7 | "module": "esnext", 8 | "moduleResolution": "node", 9 | "rootDir": "./src", 10 | "sourceMap": true, 11 | "strict": true 12 | }, 13 | "include": ["src", "types"] 14 | } 15 | --------------------------------------------------------------------------------