Configuring anyfiddle.json

You can customise and configure your project and snapshots with by editing anyfiddle.json

anyfiddle.json lets you start a project with a pre-configured state. Any project started with the file (From a starter template or snapshot) will start in this state.

A project opened the second time or later will restore the state from the previous session like open tabs, open files, etc. If the previous session is not present (Incognito mode, another browser/machine), the settings will fallback to the values in anyfiddle.json

Standard anyfiddle.json

anyfiddle.json
{
"openFiles": [
"index.js",
"static/index.html"
],
"openDirectories": [
"static"
],
"selectedFile": "index.js",
"defaultCommand": "npm start",
"port": 3000,
"preview": true,
"autorun": true,
"autoReload": true
}

Attribute

Type

Description

Default behavior

openFiles

string[]

List of file tabs to be opened

Will open an Untitled file or files from the previous session

openDirectories

string[]

List of directories to be opened in the file explorer tree

No folder will be opened or folders opened in the previous session

selectedFile

string

File tab to be selected and focused

First tab or last selected tab from the previous session

defaultCommand

string

Command to run on Run button click

The Run button will be disabled and

port

number

Port to map the public preview endpoint to open on clicking the Preview button

Port 8080

preview

boolean

Enable preview for the project. Preview pane will be shown on the right side

false

autorun

boolean

Should the default command be run when the project is started

false

autoReload

boolean

Should the preview reload automatically on content change. Content change is detected by making HEAD requests to the preview url and checking for etag changes

false