Skip to content

Commit

Permalink
chore: adjust side bar and menu
Browse files Browse the repository at this point in the history
  • Loading branch information
wre232114 committed Jan 31, 2024
1 parent f2ef4b8 commit 6e54026
Show file tree
Hide file tree
Showing 19 changed files with 85 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ If minify is enabled:
:::note
Farm use swc minifier under the hood, all options of swc minifier can be used in Farm.
:::

## minify options
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions docs/advanced/ssr.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Server-Side Rendering (SSR)
File renamed without changes.
1 change: 1 addition & 0 deletions docs/community.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Community
1 change: 1 addition & 0 deletions docs/comparisons.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Comparisons
10 changes: 4 additions & 6 deletions docs/concepts.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# Concepts
Farm is a build tool to transform and bundle your `input` to `deployable resources`. Farm will search modules start from the input, then construct a module graph and bundle these modules into several `resources`
Farm is a build tool to transform and bundle your `input` to `deployable resources`. Farm will search modules start from the input, then construct a module graph and bundle these modules into several `resources`.

Main Concepts:
* **Input**
* **Output**
* **Plugins**
* **Partial Bundling**
figure1: Input all kinds of resources and compile them into production resources.

figure2: Farm architecture, Corperation of Server, Compiler, Watcher, and Plugins.
2 changes: 1 addition & 1 deletion docs/config/compilation-options.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Configuration Reference
# Compiler Options

By default, Farm reads the configuration from the `farm.config.ts|js|mjs` file in the project root directory, an example configuration file:

Expand Down
23 changes: 23 additions & 0 deletions docs/config/configuring-farm.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Configuring Farm

By default, Farm reads the configuration from the `farm.config.ts|js|mjs` file in the project root directory, an example configuration file:

```ts title="farm.config.ts" {5-7}
import { defineConfig } from "@farmfe/core";
export default defineConfig({
root: process.cwd(), // compiled root directory
// compile options
compilation: {
//...
},
// Dev Server options
server: {
hmr: true,
//...
},
// plugin configuration
plugins: [],
});
```

This document only covers details `compilation` options. For `server` or `shared` options, refer to [server](/docs/config/dev-server) or [shared](/docs/config/shared).
2 changes: 1 addition & 1 deletion docs/config/dev-server.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Dev Server
# Dev Server Options

## DevServer Options - server

Expand Down
2 changes: 1 addition & 1 deletion docs/features/css.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Css
# Css/Sass/Less
Farm support Css out of box, just import the css file:

```tsx
Expand Down
1 change: 1 addition & 0 deletions docs/features/dev-server.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# DevServer and HMR
1 change: 1 addition & 0 deletions docs/features/env.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Enviroment Variables and Modes
3 changes: 1 addition & 2 deletions docs/features/script.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Script

# TS/TSX
Farm support compiling `Js/Jsx/Ts/Tsx` out of box, and compile `Jsx/Tsx` to React by default.

```tsx title="./button.tsx"
Expand Down
1 change: 1 addition & 0 deletions docs/migration/from-vite.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Migrate From Vite
12 changes: 12 additions & 0 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,24 @@ const config = {
position: "left",
label: "Config",
},
{
type: "doc",
docId: "api/rust-plugin-api",
position: "left",
label: "API",
},
{
type: "doc",
docId: "plugins/official-plugins/overview",
position: "left",
label: "Plugins",
},
{
type: "doc",
docId: "community",
position: "left",
label: "Community",
},
{
type: "docsVersionDropdown",
position: "right",
Expand Down
54 changes: 34 additions & 20 deletions sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const sidebars = {
type: "category",
label: "Getting Started",
collapsed: false,
items: ["why-farm", "quick-start", "using-plugins"],
items: ["why-farm", "quick-start", "concepts", "using-plugins"],
},
{
type: "category",
Expand All @@ -40,40 +40,62 @@ const sidebars = {
label: "Features",
collapsed: true,
items: [
"features/dev-server",
"features/html",
"features/css",
"features/script",
"features/static",
"features/env",
"features/lazy-compilation",
"features/partial-bundling",
"features/sourcemap",
"features/tree-shake",
"features/minification",
"features/polyfill",
"features/persistent-cache",
],
},
{
type: "category",
label: "Advanced",
collapsed: true,
items: [
"advanced/ssr",
"advanced/partial-bundling",
"advanced/tree-shake",
"advanced/minification",
"advanced/polyfill",
"advanced/persistent-cache"
],
},
{
type: "category",
label: "Migration",
collapsed: true,
items: ["migration/from-vite"],
},
"comparisons",
"benchmark",
// {
// type: "category",
// label: "Benchmark",
// collapsed: false,
// items: ["benchmark"],
// },
],
configSidebar: [
{
type: "category",
label: "Configuration Reference",
collapsed: false,
items: [
"config/configuring-farm",
"config/compilation-options",
"config/dev-server",
"config/shared",
"config/environment-variable",
"config/plugins-options",
],
},
{
type: "category",
label: "CLI",
collapsed: false,
items: ["cli/cli-api"],
},
// "config/farm-config",
// "config/cli",
],
apiSidebar: [
{
type: "category",
label: "Api Reference",
Expand All @@ -86,14 +108,6 @@ const sidebars = {
"api/rust-api",
],
},
{
type: "category",
label: "CLI",
collapsed: false,
items: ["cli/cli-api"],
},
// "config/farm-config",
// "config/cli",
],
pluginSidebar: [
{
Expand Down

0 comments on commit 6e54026

Please sign in to comment.