Skip to content

Latest commit

 

History

History
114 lines (76 loc) · 2.15 KB

_SETUP.md

File metadata and controls

114 lines (76 loc) · 2.15 KB

Setup

At webpack we use yarn to execute commands.

If you already have yarn installed, do: yarn setup. This will complete all required steps.

If not, do: npm run setup, the setup will also install yarn for you.

That's all.

Automated environments

yarn setup is all any environment needs. Off a terminal — CI, a throwaway sandbox, any coding agent — it switches itself to a non-interactive path: it verifies yarn.lock rather than rewriting it, installs no global yarn, and links the checkout in as node_modules/webpack without touching yarn's machine-global link registry. Safe to re-run either way.

The path is chosen from whether both streams are a terminal and CI is unset. An agent that allocates a PTY therefore reads as a contributor and should set WEBPACK_SETUP=automated; WEBPACK_SETUP=interactive forces the other way. The interactive path is also the one that installs yarn when it is missing, so npm run setup still does that from a terminal.

Setup manually

Setup your local webpack repository

git clone https://github.com/webpack/webpack.git
cd webpack
npm install -g yarn
yarn
yarn link
yarn link webpack

To run the entire test suite use

yarn test

To run only integration tests use

yarn test:integration

or in watch mode

yarn test:integration --watch

To run only unit tests use

yarn test:unit

or in watch mode

yarn test:unit --watch

To update Jest snapshots use

yarn test:update-snapshots

To run benchmarks

yarn benchmark

To run code formatter (prettier) run

yarn fmt

To run all linters use

This performs linting on:

  • eslint (lint:code script)
  • dependencies (lint:yarn script)
  • types (lint:types script)
  • schema + format + generated files (lint:special script)
yarn lint

To run only the typechecker use

yarn lint:types

or incremental (in watch mode)

yarn lint:types --watch

To update all examples use

yarn build:examples

To update a specific example use

cd examples/<path to example>
node build.js