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
Now you can run the migrator using `tw-mg` command
37
+
38
+
## Options
39
+
40
+
### -h, --help
41
+
42
+
Show help
43
+
44
+
### -s, --style - required
45
+
46
+
Path to atomizer generated css file, it contains all the generated classes
47
+
48
+
### -t, --target <glob-pattern> - required
49
+
50
+
Target files to transform, supports glob pattern
51
+
52
+
### -d, --dry-run
53
+
54
+
Dry run mode, will only generate report and open it
55
+
56
+
### -no, --no-open
57
+
58
+
Do not open report in browser
59
+
60
+
### -m, --mappings
61
+
62
+
Path to json file with mappings from atomizer classes to tailwindcss classes, for example we may want to replace `$fzTitle` variable with `title` in tailwindcss variable so any class like `Fz($fzTitle)` will be replaced with `text-title`
63
+
64
+
Ex:
65
+
66
+
```json
67
+
{
68
+
"$fzTitle": "title"
69
+
}
70
+
```
71
+
72
+
### -p, --plugins
73
+
74
+
Path to js file with plugins which will be loaded by the migrator this can be helpful if you want to do some custom transformation
75
+
for help on writing plugins see [Writing Plugins](#writing-plugins)
Plugin file must export an array of plugins which will be loaded by the migrator.
141
+
Plugin file must export an array of plugins which will be loaded by the migrator, plugins must be an object with `name` and `plugin` keys where `name` is the name of the plugin and `plugin` is a function which will be called for each atomizer class with `className` and `mappings` as arguments, `className` is the atomizer class and `mappings` is the mappings object passed to the migrator
93
142
94
143
```js
95
144
module.exports= [
96
145
{
97
146
name:'plugin-name',
98
-
plugin:function (atomizer, mappings) {
147
+
plugin:function (className, mappings) {
99
148
// do something with atomizer
100
149
// return null in case you want to skip this plugin
0 commit comments