The Wix IDE provides a browser-based environment built on Visual Studio Code for writing code for Wix Studio sites and Blocks apps.
To use the Wix IDE, open the Blocks code editor and click the Code in Wix IDE button. The Wix IDE opens in a new browser tab, allowing you to edit your app's code.
Changes are automatically synced to your app, and the IDE's autosave is enabled by default. You can turn autosave off in the Wix IDE Settings editor.
After coding in the Wix IDE, you can preview your app in Blocks, test your code in the Editor, and release a version of your app.
Blocks apps have a specific file structure that Wix uses to run your code. When you open the Wix IDE, you will see the following file structure for your app:
Backend folder: Contains the backend code files for your app. Your backend files can include:
.web.js
file extensions.http-functions.js
file for implementing HTTP functions.events.js
file for implementing your app's backend event handlers.config.json
Configuration file for defining specific settings for your app. You’ll see this file only if you added a Configuration file in Blocks.Site folder: Contains code files for each of the widgets or plugins in your app, including a Panels subfolder for their custom panels. The code you add to these files runs when visitors use the widgets on a site. Code files are created when the widgets, plugins or panels are added and deleted when removed.
Public folder: Contains the public code files for your app. You can import code from these files into any other file on your app.
Dashboard folder: Contains a file for every dashboard page in your app. Code files are created when the dashboard page is created and deleted when removed.
README file: A Markdown file to document your app.
Other files: The jsconfig.json
file and .wix
folder are in the repo's root folder.
They are used to support type checking and autocomplete in the IDE. You don't need to edit these files. Changes to these files aren't synced to your app and are lost when you close the IDE.
robots.txt
, ads.txt
, and security.txt
to your app. If you add these files, they're ignored by Wix.To import code from public files:
To import code from backend files:
Note: Trying to import from the relative path in your app’s files doesn't work.
The name of the file for widgets, panels and dashboard pages have two parts, separated by a period.
For example:
Widget 1.odjx6.js
New Panel 1.yjxgv.js
Do not rename widget, panel, or dashboard code files. Wix uses these file names to associate files with their respective components. Renaming a file will result in your code being ignored, and a new file will be created.
Certain actions cannot be performed in the Wix IDE and must be done in Blocks:
Multiple app collaborators can edit code simultaneously in the Wix IDE. Changes are synced in real-time.
However, you cannot edit your app's code in both the Wix IDE and the Wix Blocks Code panel at the same time. If the Wix IDE is open, the Code panel switches to read-only mode.
To edit in the Code panel, all collaborators must close the Wix IDE. You can then click Start Coding in the Code panel.
The Wix AI Assistant is available in the Wix IDE, but it doesn’t yet support Blocks.