'How to set up rollup so that a Svelte project is automatically compiled on save without being served?
In a Svelte project there are already three scripts set up inside the package.json file
"scripts": {
"build": "rollup -c",
"dev": "rollup -c -w",
"start": "sirv public --single"
},
What I understand from the rollup.config.js file
- running
npm run buildcompiles the project to thepublicfolder and minifies the files once - running
npm run devcompiles without minifying and automatically runsnpm run startafter compilation so the public folder is served and reloaded on change
Since I'm using firebase emulators which includes emulating the hosting and serving of the public directory I'm looking for a way to only automatically compile the Svelte project when saving without the serving ~ how can I achieve this?
EDIT: How can I achieve this by modifying the rollup.config in a way that an additional script e.g. "autobuild": "..." can be added to easily switch between the different modes?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
