Additional Settings
Settings for DevLink setup in apps
DevLink references a configuration file that defines settings for DevLink setup and sync. While DevLink will try to assume reasonable defaults for most of the settings, you can specify certain options to customize the behavior of DevLink management and setup.
Configuration files
DevLink supports the following configuration files at the root of your project:
.webflowrc.js
webflow.json
webflow.json
is a newer configuration file that supports configuration for Webflow Cloud and DevLink. DevLink also supports the older .webflowrc.js
file for backwards compatibility.
Configuration options
Sync a subset of your components
To optimize your DevLink sync process, you can selectively sync specific components from your Webflow project instead of syncing all components. This is useful if you have a lot of components in your Webflow project that you don’t need to sync to DevLink.
Or you can use regular expressions:
Additionally, you can specify a list of components when running the sync command:
File extensions
By default, all DevLink component files use the .js
and .css
extensions, but you can also configure .jsx
and other CSS extensions (i.e. .less
) if preferred.
Environment variables
Some Webflow elements require an API key to function correctly:
- Maps
- Recaptcha
DevLink doesn’t export your API keys set on your Webflow site, therefore you’ll need to provide them via environment variables.
If you already have those keys set up in your project and don’t want to duplicate them or rename them, you can also provide a mapping in the .webflowrc.js
file.
Skipping global CSS rules
By default, DevLink exports a global.css stylesheet containing opinionated rules and selectors (such as html
and h1
). If you need to disable this behavior and only include the bare minimum in order for DevLink components to work, you should set the skipTagSelectors
to true
in your .webflowrc
configuration file.
<Navbar/>
and <Dropdown/>
builtin components rely on the viewport having sufficient height or width to function. When disabling global tags, make sure that the parent elements of your DevLink components have a defined height/width OR your <html/>
and <body/>
have height: 100%;
set.
Skipping CSS modules
By default, DevLink exports a CSS module for each component to avoid style name collisions. While using CSS Modules is recommended, if you need to skip this behavior, you should set the cssModules
to false
.
Crash reports
When the DevLink sync command fails, you’ll see a prompt in the terminal with the opportunity to send Webflow a crash report for triage and improving the DevLink experience. You can decide to opt in or out with the allowTelemetry
flag which will bypass the prompt should the sync command fail again.
Other settings
host
: The Webflow API host. This is usuallyhttps://api.webflow.com
.rootDir
: The root directory where DevLink will create the component files. (i.e../devlink
)siteId
: The Webflow site ID for the project you want to sync components fromauthToken
: The Webflow API token for the project you want to sync components from. This is usually set in an.env
file. You should avoid putting the API token inline in the.webflowrc.js
file if you are checking this code in a central repo