-
-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy path.figmaexportrc.example.ts
59 lines (54 loc) · 1.9 KB
/
.figmaexportrc.example.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/**
* If you want to try this configuration you can just run:
* $ npm install --save-dev typescript tsx @types/node @figma-export/types
* $ npm install --save-dev @figma-export/output-styles-as-sass @figma-export/transform-svg-with-svgo @figma-export/output-components-as-svg
*/
import { FigmaExportRC, StylesCommandOptions, ComponentsCommandOptions } from '@figma-export/types'
import outputComponentsAsSvg from '@figma-export/output-components-as-svg'
import outputStylesAsSass from '@figma-export/output-styles-as-sass'
import transformSvgWithSvgo from '@figma-export/transform-svg-with-svgo'
const styleOptions: StylesCommandOptions = {
fileId: 'fzYhvQpqwhZDUImRz431Qo',
// version: 'xxx123456', // optional - file's version history is only supported on paid Figma plans
// ids: ['138:52'], // optional - Export only specified node IDs (the `onlyFromPages` option is always ignored when set)
// onlyFromPages: ['icons'], // optional - Figma page names or IDs (all pages when not specified)
outputters: [
outputStylesAsSass({
output: './output'
})
]
}
const componentOptions: ComponentsCommandOptions = {
fileId: 'fzYhvQpqwhZDUImRz431Qo',
// version: 'xxx123456', // optional - file's version history is only supported on paid Figma plans
// ids: ['54:22'], // optional - Export only specified node IDs (the `onlyFromPages` option is always ignored when set)
onlyFromPages: ['icons'],
transformers: [
transformSvgWithSvgo({
plugins: [
{
name: 'preset-default',
params: {
overrides: {
removeViewBox: false,
}
}
},
{
name: 'removeDimensions'
}
]
})
],
outputters: [
outputComponentsAsSvg({
output: './output'
})
]
}
export default {
commands: [
['styles', styleOptions],
['components', componentOptions]
]
} satisfies FigmaExportRC