When we first install Svelte.js on our system, the starter template comes with the following structure by default:
Let's see them in detail:
package.json and package-lock.json: The package.json and package-lock.json contain the information about the project that Node.js/npm uses to keep it organized.
node_modules: The node_modules file specifies where the node saves the project dependencies. These dependencies are used for development purposes only and won't be sent to production.
.gitignore: This is used to tell git which files or folders to ignore from the project. It is required if you decide to include your app in a git repo.
rollup.config.js: In Svelte, the rollup.config.js is used as a module bundler. This configuration is used to tell rollup how to compile and build your app. It would be skipped if you use webpack to create your starter project with npx degit sveltejs/template-webpack svelte-app.
scripts: It contains the required setup scripts. Currently, it holds only contain setupTypeScript.js.
src: This directory is used to specify where the source code for your application lives and where you have to create the code for your app. It contains two components: App.svelte and main.js
public: The public is a directory containing all the files required to be published in production. This directory consists of the following files: