Skip to content
Advertisement

Tag: svelte

Rollup : single html output

I’m trying to package my Svelte app into a single Html file output. I’ve managed to get the desired output with a configuration based on that answer : Output Single HTML File from Svelte Project With “npm run dev” everything is fine with the first build, but I’m having issues following (live-reload) builds: bundle[‘bundle.css’] is not filled in my inlineSvelte’s

Svelte store function update

Svelte store documentation shows String or Integer being updated, but I did not find any dynamic function in store. I don’t understand how to make the getData function as a writable in order to notify the html of the change. In the following sample, I would like b to be shown after the updateKey function is called. You will find

Error when import a node_module on svelte

i have to create a module to use on my application, but when I import that in my major project i have this error I have not the folder dist/index.js, in the guide I followed I did not see that it was necessary to make the package, also in another project i did not have these problems. My version of

Making class instance reactive in Svelte using stores

I am learning Svelte by creating simple app. The logic is written using classes. The idea is, that all the data needed comes from class instance properties. Instances should not be instantiated more than once. I am using stores to provide components this instances. The problem is I can’t get reactivity using this approach. I tried readable and writable stores

Props not appearing in Svelte DevTools

I’m building an app as a way to learn Svelte. It’s all functioning perfectly, but when I look at it in Svelte DevTools, the props on components don’t appear, although their values appear in the state as an array. I guess I must be doing something wrong, but can anyone tell me what? The screenshot shows the app with the

In svelte, how to `console.log(‘yes’)` when a variable changed?

If we want to print the value of c when it is changed, we can write like above. Because c is used in $ directive literally, so this statement can be reactive to c. But what if I just want to console.log(‘yes’) when c is changed? Obviously, the statement console.log(‘yes’) is not reactive to c. Furthermore, if I still console.log(c)

Advertisement