# @mill3-packages/wp-boilerplate

> ![npm](https://img.shields.io/npm/v/@mill3-packages/wp-boilerplate?style=flat-square)

Latest version **0.1.9** (published 2021-01-15) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @mill3-packages/wp-boilerplate
pnpm add @mill3-packages/wp-boilerplate
yarn add @mill3-packages/wp-boilerplate
bun add @mill3-packages/wp-boilerplate
```

Provides the command `mill3-wp`.

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.1.9 |
| Published | 2021-01-15 |
| First published | 2020-05-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 64 |
| Unpacked size | 929.1 KB |
| Known vulnerabilities | 0 (+12 in 3 direct dependencies) |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Mill3 Studio |
| Maintainers | thetoine, ebhoren |
| Keywords | webpack, wordpress, sass, boilerplate |

## Links

- npm: https://www.npmjs.com/package/@mill3-packages/wp-boilerplate
- Repository: https://github.com/Mill3/mill3-packages
- Homepage: https://github.com/Mill3/mill3-packages/tree/master/packages/wp-theme-boilerplate
- Issues: https://github.com/Mill3/mill3-packages/issues
- npm.io page: https://npm.io/package/@mill3-packages/wp-boilerplate

## Dependencies (64)

- [args](https://npm.io/package/args.md) ^5.0.1
- [path](https://npm.io/package/path.md) ^0.12.7
- [chalk](https://npm.io/package/chalk.md) ^4.0.0
- [husky](https://npm.io/package/husky.md) ^3.0.9
- [dotenv](https://npm.io/package/dotenv.md) ^8.2.0
- [eslint](https://npm.io/package/eslint.md) ^6.5.1
- [figlet](https://npm.io/package/figlet.md) ^1.4.0
- [animejs](https://npm.io/package/animejs.md) ^3.1.0
- [cssnano](https://npm.io/package/cssnano.md) ^4.1.10
- [get-env](https://npm.io/package/get-env.md) ^0.5.10
- [postcss](https://npm.io/package/postcss.md) ^7.0.14
- [prompts](https://npm.io/package/prompts.md) ^2.3.2
- [webpack](https://npm.io/package/webpack.md) ^4.30.0
- [debounce](https://npm.io/package/debounce.md) ^1.2.0
- [domready](https://npm.io/package/domready.md) ^1.0.8
- [fs-extra](https://npm.io/package/fs-extra.md) ^9.0.0
- [prettier](https://npm.io/package/prettier.md) 1.18.2
- [commander](https://npm.io/package/commander.md) ^5.1.0
- [node-sass](https://npm.io/package/node-sass.md) ^4.11.0
- [splitting](https://npm.io/package/splitting.md) ^1.0.6
- [@babel/cli](https://npm.io/package/@babel/cli.md) ^7.4.3
- [css-loader](https://npm.io/package/css-loader.md) ^3.2.0
- [webpackbar](https://npm.io/package/webpackbar.md) ^4.0.0
- [@babel/core](https://npm.io/package/@babel/core.md) ^7.4.3
- [@babel/node](https://npm.io/package/@babel/node.md) ^7.2.2
- [@barba/core](https://npm.io/package/@barba/core.md) ^2.9.7
- [file-loader](https://npm.io/package/file-loader.md) ^4.2.0
- [path-exists](https://npm.io/package/path-exists.md) ^4.0.0
- [sass-easing](https://npm.io/package/sass-easing.md) ^1.0.3
- [sass-loader](https://npm.io/package/sass-loader.md) ^8.0.0
- [webpack-cli](https://npm.io/package/webpack-cli.md) ^4.3.1
- [autoprefixer](https://npm.io/package/autoprefixer.md) ^9.5.1
- [babel-loader](https://npm.io/package/babel-loader.md) ^8.0.5
- [imagesloaded](https://npm.io/package/imagesloaded.md) ^4.1.4
- [postcss-scss](https://npm.io/package/postcss-scss.md) ^2.0.0
- [pretty-quick](https://npm.io/package/pretty-quick.md) 2.0.0
- [style-loader](https://npm.io/package/style-loader.md) ^1.0.0
- [@vimeo/player](https://npm.io/package/@vimeo/player.md) ^2.15.0
- [eventemitter2](https://npm.io/package/eventemitter2.md) ^6.4.3
- [postcss-import](https://npm.io/package/postcss-import.md) ^12.0.1
- [postcss-loader](https://npm.io/package/postcss-loader.md) ^3.0.0
- [@babel/register](https://npm.io/package/@babel/register.md) ^7.4.0
- [prettier-eslint](https://npm.io/package/prettier-eslint.md) 9.0.0
- [replace-in-file](https://npm.io/package/replace-in-file.md) ^4.1.3
- [sass-json-loader](https://npm.io/package/sass-json-loader.md) ^1.0.1
- [@babel/preset-env](https://npm.io/package/@babel/preset-env.md) ^7.4.3
- [locomotive-scroll](https://npm.io/package/locomotive-scroll.md) ^3.3.11
- [webpack-dashboard](https://npm.io/package/webpack-dashboard.md) ^3.0.2
- [postcss-preset-env](https://npm.io/package/postcss-preset-env.md) ^6.6.0
- [webpack-dev-server](https://npm.io/package/webpack-dev-server.md) ^3.11.2
- [@babel/preset-react](https://npm.io/package/@babel/preset-react.md) ^7.0.0
- [prettier-eslint-cli](https://npm.io/package/prettier-eslint-cli.md) 5.0.0
- [base64-inline-loader](https://npm.io/package/base64-inline-loader.md) ^1.1.1
- [clean-webpack-plugin](https://npm.io/package/clean-webpack-plugin.md) ^3.0.0
- [image-webpack-loader](https://npm.io/package/image-webpack-loader.md) ^7.0.1
- [load-google-maps-api](https://npm.io/package/load-google-maps-api.md) ^2.0.2
- [assets-webpack-plugin](https://npm.io/package/assets-webpack-plugin.md) ^3.9.10
- [mini-css-extract-plugin](https://npm.io/package/mini-css-extract-plugin.md) ^0.8.0
- [postcss-clip-path-polyfill](https://npm.io/package/postcss-clip-path-polyfill.md) ^1.0.4
- [@mill3-packages/system-ui-sass](https://npm.io/package/@mill3-packages/system-ui-sass.md) ^0.6.2
- [directory-named-webpack-plugin](https://npm.io/package/directory-named-webpack-plugin.md) ^4.0.1
- [optimize-css-assets-webpack-plugin](https://npm.io/package/optimize-css-assets-webpack-plugin.md) ^5.0.1
- [@babel/plugin-proposal-class-properties](https://npm.io/package/@babel/plugin-proposal-class-properties.md) ^7.4.0
- [@babel/plugin-proposal-object-rest-spread](https://npm.io/package/@babel/plugin-proposal-object-rest-spread.md) ^7.4.3

## Alternatives

- [raw-loader](https://npm.io/package/raw-loader.md) — 4.3M weekly downloads
- [plop](https://npm.io/package/plop.md) — 1.4M weekly downloads
- [webpack-deadcode-plugin](https://npm.io/package/webpack-deadcode-plugin.md) — 80.3K weekly downloads
- [@storybook/preact-vite](https://npm.io/package/@storybook/preact-vite.md) — 54.2K weekly downloads
- [vite-plugin-transform](https://npm.io/package/vite-plugin-transform.md) — 2.4K weekly downloads

## Recent versions

- 0.1.9 (latest) — 2021-01-15
- 0.1.8 — 2021-01-14
- 0.1.7 — 2021-01-14
- 0.1.6 — 2021-01-14
- 0.1.5 — 2021-01-14
- 0.1.4 — 2021-01-13
- 0.1.3 — 2021-01-13
- 0.1.2 — 2021-01-13
- 0.1.1 — 2020-12-10
- 0.1.0 — 2020-12-10
- 0.0.18 — 2020-10-26
- 0.0.17 — 2020-10-09
- 0.0.16 — 2020-07-27
- 0.0.15 — 2020-07-15
- 0.0.14 — 2020-07-07
- … 11 more at https://npm.io/package/@mill3-packages/wp-boilerplate/versions

## README

![npm](https://img.shields.io/npm/v/@mill3-packages/wp-boilerplate?style=flat-square)

# MILL3-packages : Wordpress Theme Boilerplate with Webpack

Our WP theme boilerplate using Timber/Twig templates

![](https://media.giphy.com/media/XyJjfbEPltkHE4s7hg/giphy.gif)

## Requirements

- npm / yarn
- [Timber WP plugin](https://github.com/timber/timber/)

## How to install

Our boilerplate package is distributed with NPM, init a new project and install with it :

**Note:** make sure you run thoses commands inside a fresh empty WP theme directory. Not at the root of your Wordpress installation.

```bash
npm init
npm install @mill3-packages/wp-boilerplate
```

## How to use for local development

Edit `wp-config.php` and add this constant :

```php
define('THEME_DEV', true);
```

Make sure the _name_ line in `package.json` matches your theme's directory name.

```json
{
  "name": "mill3-wp-boilerplate",
  "version": "2.0.0"
}
```

Directory :

```
/wp-content/themes/mill3-wp-boilerplate/
```

Add bin command to your package.json file :

```json
{
  "scripts": {
    "mill3-wp": "mill3-wp"
  }
}
```

Run the install script :

```bash
npm run mill3-wp install
```

Then start Webpack dev server

```bash
npm run mill3-wp dev
```

## Local development with Docker

You can also use our [Docker boilerplate](https://github.com/Mill3/wordpress-docker-boilerplate) for WordPress which will set the `THEME_DEV` constant for you on initial Docker up command. Check out the repository : https://github.com/Mill3/wordpress-docker-boilerplate

## Production assets build

Simply run :

```bash
npm run mill3-wp build
```

In production mode, assets are loaded from dist/assets.json file, cache busting included !

## Prettier/ESLint

You can ESLint your code with the following command :

First add in package's script :

```json
{
  "scripts": {
    "lint": "eslint --fix ./src/js",
    "prettier": "prettier-eslint ./src/js/*/*.js ./src/scss/**/*.scss --write"
  }
}
```

```bash
npm run lint
```

And Prettier formatting :

```bash
npm run prettier
```

Please also note that there's a pre-commit hook using [pretty-quick](https://github.com/azz/pretty-quick) which can be added in `package.json`.

```json
"husky": {
  "hooks": {
    "pre-commit": "pretty-quick --staged"
  }
}
```

---
_Source: https://npm.io/package/@mill3-packages/wp-boilerplate · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
