You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Be API Frontend Framework** (BFF) is a friendly Front-end WordPress theme boilerplate to help you to start your own WordPress theme with modern tools.
10
6
11
-
## ⚒️ Main tools
12
-
*[Webpack 5](https://webpack.js.org/) JS, CSS and assets are built with Webpack.
13
-
*[Esbuild Loader](https://github.com/privatenumber/esbuild-loader) for ESNext & TypeScript transpilation.
14
-
*[Eslint](https://eslint.org/) for JS code style.
15
-
*[Stylelint](https://stylelint.io/) for CSS code style.
16
-
*[CSSNano](https://cssnano.co/) for CSS optimization
17
-
*[PostCSS Preset Env](https://github.com/csstools/postcss-preset-env) for modern CSS properties compatibility.
18
-
*[PostCSS PX to REM](https://github.com/cuth/postcss-pxtorem) to automatically convert px units to rem.
19
-
*[PostCSS Sort Media Queries](https://github.com/solversgroup/postcss-sort-media-queries) to combine multiple similar medie queries declarations.
20
-
*[SVGO](svgo-loader) for SVG optimization.
21
-
*[Image Webpack Loader](image-webpack-loader) for images optimization.
22
-
*[Browser Sync](https://browsersync.io/) to test your project on different devices.
7
+
## What is BFF ?
23
8
9
+
**Be API Frontend Framework***(or BFF)* is a WordPress theme boilerplate designed to assist you in launching your own WordPress theme using modern tools.
24
10
25
-
26
-
## 🔴 Requirements
11
+
## Requirements
27
12
28
13
### Composer
14
+
29
15
You need composer to autoload all your classes from the inc folder.
30
16
31
17
Use the `beapi/composer-scaffold-theme` package that add it automatically to the composer.json file.
@@ -40,11 +26,12 @@ You can add it yourself like this :
40
26
```
41
27
42
28
### Autoload
29
+
43
30
The autoload is based on psr-4 and handled by composer.
44
31
45
-
### Node 12+
32
+
### Node.js
46
33
47
-
You need a minimum of Node 12. Version 14 is recommended.
34
+
You need [the latest stable version of Node.js](https://nodejs.org/).
48
35
49
36
## Installation
50
37
@@ -65,32 +52,32 @@ Of course, you can rename `beapi-frontend-framework` to define your WordPress th
65
52
Next, go to your theme folder (in the following example, I didn't rename `beapi-frontend-framework`) with your favorite Term software.
66
53
67
54
```bash
68
-
$ cd wp-content/themes/beapi-frontend-framework
55
+
cd wp-content/themes/beapi-frontend-framework
69
56
```
70
57
71
58
Then install node dependencies with Yarn.
59
+
72
60
```bash
73
-
$ yarn
61
+
yarn
74
62
```
63
+
75
64
Alternatively, you can use NPM.
65
+
76
66
```bash
77
-
$ npm install
67
+
npm install
78
68
```
79
69
80
-
## ⚙️ Configuration
70
+
## Configuration
81
71
82
72
The configurations files are in `config` directory.
73
+
83
74
### Webpack
75
+
84
76
You can find the common Webpack settings file in `webpack.common.js`. For development mode purpose, you can edit `webpack.dev.js` file and for production mode, you can edit `webpack.prod.js`.
85
77
You also have the loaders in `loaders.js` file and Webpack's plugin in `plugins.js` file.
86
78
87
-
### Babel
88
-
You can find a `.babelrc` file to modify Babel configuration.
79
+
## How to use BFF ?
89
80
90
-
### Eslint
91
-
You can find a `.eslintrc` file to modify Eslint configuration.
92
-
93
-
## 🚀 How to use BFF ?
94
81
After installing dependencies, you can run some commands which are explained below.
95
82
96
83
### Start with Browser Sync
@@ -100,23 +87,25 @@ BFF is configured to work with [lando](https://lando.dev/). If you have a `.land
100
87
```js
101
88
let fileContents =fs.readFileSync('../../../../.lando.yml', 'utf8')
102
89
```
103
-
Then, run the following command from the theme :
104
90
91
+
Then, run the following command from the theme :
105
92
106
93
```bash
107
-
$ yarn start
94
+
yarn start
108
95
```
96
+
109
97
BrowserSync will proxy your lando'server based on the name defined in your `.lando.yml`.
98
+
110
99
### Build
111
100
112
101
```bash
113
-
$ yarn build
102
+
yarn build
114
103
```
115
104
116
105
### Bundle report
117
106
118
107
You can launch a bundle report with the following command :
0 commit comments