Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,17 @@ for caching to work (optional).

Bundlephobia relies on [`canvas`](https://www.npmjs.com/package/canvas) which may need to be built from source (depending on your platform). If so, [install the required packages listed in their docs](https://github.com/Automattic/node-canvas#compiling).

### Setup

1. Make sure you have `pnpm` installed.
2. `pnpm install`
3. Create a `.env` file from `.env.defaults` or just rely on defaults (already handled by `dotenv-defaults`).
4. `pnpm dev` to start the development server.

### Commands

| script | description |
| ---------------- | :--------------------------------- |
| `yarn run dev` | Start a development server locally |
| `yarn run build` | Build for production |
| `yarn run prod` | Start a production server locally |
| `pnpm run dev` | Start a development server locally |
| `pnpm run build` | Build for production |
| `pnpm run prod` | Start a production server locally |
16 changes: 16 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const nextJest = require('next/jest')

const createJestConfig = nextJest({
// Provide the path to your Next.js app to load next.config.js and .env files in your test environment
dir: './',
})

// Add any custom config to be passed to Jest
const customJestConfig = {
// if using TypeScript with a baseUrl set to the root directory then you need the below for alias' to work
moduleDirectories: ['node_modules', '<rootDir>/'],
testEnvironment: 'jest-environment-jsdom',
}

// createJestConfig is exported this way to ensure that next/jest can load the Next.js config which is async
module.exports = createJestConfig(customJestConfig)
Loading