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: docs/api/inline-style-prefixer-generator/generateData.md
+6
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,11 @@
1
1
# `generateData(browserList, options)`
2
2
3
+
> You need to have the `caniuse-api` package installed.
4
+
5
+
```sh
6
+
yarn add caniuse-api --dev
7
+
```
8
+
3
9
Generates all the data needed to create your own prefixer. It uses a list of browser versions to determine the required prefixes. It also writes the data to files if `staticPath` and/or `dynamicPath` is provided. The files are directly written in valid JavaScript, so that they can be imported and used as is.
4
10
5
11
The files always have the following shape (ES2015 example):
Copy file name to clipboardexpand all lines: docs/guides/CustomPrefixAll.md
+6
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,12 @@ This guide is quite similar to [Creating your own Prefixer](CustomPrefixer.md),
4
4
Make sure to read it first, as it describes the concepts with much more detail, as not everything is repeated here as well.
5
5
6
6
## Generating static data
7
+
First of all we need to install the `caniuse-api`.
8
+
9
+
```sh
10
+
yarn add caniuse-api --dev
11
+
```
12
+
7
13
Again, we are using [`generateData`](../api/inline-style-prefixer-generator/generateData.md) and a `browserList` to get our static data. This we will save the data to the `staticPath`.
Copy file name to clipboardexpand all lines: docs/guides/CustomPrefixer.md
+6
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,12 @@
3
3
If your application requires different browser version support, you might consider creating your own `Prefixer`. To make it as simple as possible, we provide two different tools to get there. First of all, we have the [inline-style-prefixer/generator](../api/inline-style-prefixer-generator/generateData.md) that helps to generate the required prefixing data. Then, you can use [`createPrefixer`](../api/inline-style-prefixer/createPrefixer.md) to plug it all together.
4
4
5
5
## Generating dynamic data
6
+
First of all we need to install the `caniuse-api`.
7
+
8
+
```sh
9
+
yarn add caniuse-api --dev
10
+
```
11
+
6
12
Each Prefixer needs to know which properties to prefix and which plugins to use. This data can be generated using [`generateData`](../api/inline-style-prefixer-generator/generateData.md).
7
13
You need to provide a `browserList` containing all the minimum browser versions that should be supported.
0 commit comments