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
Copy file name to clipboardexpand all lines: www/pages/plugins/custom-plugins.md
+2
Original file line number
Diff line number
Diff line change
@@ -14,6 +14,8 @@ The available plugins built and maintained by Greenwood team and contibutors hav
14
14
|---|---|
15
15
|[Google Analytics](https://github.com/ProjectEvergreen/greenwood/tree/master/packages/plugin-google-analytics)| Easily add usage tracking to your site with Google Analytics. |
16
16
|[Import CommonJs](https://github.com/ProjectEvergreen/greenwood/tree/master/packages/plugin-import-commonjs)| Enables usage of `import` syntax for loading CommonJS modules from _node_modules_. |
17
+
|[Import CSS](https://github.com/ProjectEvergreen/greenwood/tree/master/packages/plugin-import-css)| Enables usage of `import` syntax for loading CSS files. |
17
18
|[Polyfills](https://github.com/ProjectEvergreen/greenwood/tree/master/packages/plugin-polyfills)| Although most modern browsers now support the APIs that make up Web Component, for older browsers use this plugin to Let Greenwood automatically take care of progressively loading polyfills for you. |
19
+
|[PostCSS](https://github.com/ProjectEvergreen/greenwood/tree/master/packages/plugin-postcss)| Allows usage of [**PostCSS**](https://postcss.org/) plugins and configuration in your project. |
18
20
19
21
> See something missing? Please review our [open issues](https://github.com/ProjectEvergreen/greenwood/issues), we might be [working on it](https://github.com/ProjectEvergreen/greenwood/projects)! Or if not, please request it, we would be interested to learn how you need to use Greenwod and how the team can help!
Copy file name to clipboardexpand all lines: www/pages/plugins/index.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -24,7 +24,7 @@ Greenwood aims to cater to these use cases through two approaches:
24
24
### API
25
25
Each plugin must return a function that has the following three properties:.
26
26
-`name`: A string to give your plugin a name and used for error handling and troubleshooting.
27
-
-`type`: A string to specify to Greenwood the type of plugin. Right now the current supported plugin type [`'resource'`](/plugins/resource/)and [`'plugin'`](/plugins/server/).
27
+
-`type`: A string to specify to Greenwood the type of plugin. Right now the current supported plugin types are [`'resource'`](/plugins/resource/), [`'rollup'`](/plugins/rollup/), and [`'server'`](/plugins/server/).
28
28
-`provider`: A function that will be invoked by Greenwood that Can accept a `compilation` param that provides read-only access to parts of Greenwood's state and configuration that can be used by a plugin.
29
29
30
30
Here is an example of creating a plugin in a _greenwood.config.js_.
These plugins allow users to tap into the [Rollup](https://rollupjs.org/) configuration that Greenwood uses to build and optimize the static assets (JS / CSS) of your site when running the `build` command. Simply use the `provider` method to return an array of rollup plugins. Easy!
11
+
12
+
### Example
13
+
Install your favorite rollup plugin(s), then create a simple object to provde those plugins.
banner(`/* ${packageJson.name} v${packageJson.version} - built at ${now}. */`)
27
+
]
28
+
}];
29
+
};
30
+
```
31
+
32
+
> _You can click to see an [example of a rollup plugin](https://github.com/ProjectEvergreen/greenwood/tree/master/packages/plugin-import-css), which requires a rollup plugin as part of enabling `import` syntax for CSS files._
0 commit comments