svelte

Output Single HTML File from Svelte Project

梦想的初衷 提交于 2021-01-27 14:52:38
问题 I can't find any example anywhere online that shows how to (or if we can) output a single HTML file from a Svelte project using Rollup (not Webpack), containing all CSS and JS injected inline (and not as URLs in script). 回答1: There is no built-in way to achieve this, so you'll have to write your own plugin to do so. This code is some sort of an attemt to get this done and could act as a starter point. It is in no way actually complete or good. (to be honest I doubt you will be winning any

Output Single HTML File from Svelte Project

隐身守侯 提交于 2021-01-27 14:41:22
问题 I can't find any example anywhere online that shows how to (or if we can) output a single HTML file from a Svelte project using Rollup (not Webpack), containing all CSS and JS injected inline (and not as URLs in script). 回答1: There is no built-in way to achieve this, so you'll have to write your own plugin to do so. This code is some sort of an attemt to get this done and could act as a starter point. It is in no way actually complete or good. (to be honest I doubt you will be winning any

I have some questions about Sapper/Svelte

微笑、不失礼 提交于 2021-01-27 12:48:07
问题 I just started using Sapper (https://sapper.svelte.technology) for the first time. I really like it so far. One of the things I need it to do is show a list of the components available in my application and show information about them. Ideally have a way to change the way the component looks based on dynamic bindings on the page. I have a few questions about using the framework. First, I'll provide a snippet of my code, and then a screenshot: [slug].html ----------- <:Head> <title>{{info

How can I manually compile a svelte component down to the final javascript and css that sapper/svelte produces?

谁都会走 提交于 2021-01-24 07:16:41
问题 Our company produces an automation framework that is written in svelte/sapper. One feature is that developers can create custom ui widgets, currently using plain js/html/css and our client side api. These widgets are stored in the database and not on the file system. I think it would be a big plus to allow them to create widgets as svelte components since it contains all of the markup, js and css in one location and would give them all of the benefits of svelte's reactivity. I have gotten as

How can I manually compile a svelte component down to the final javascript and css that sapper/svelte produces?

ε祈祈猫儿з 提交于 2021-01-24 07:14:27
问题 Our company produces an automation framework that is written in svelte/sapper. One feature is that developers can create custom ui widgets, currently using plain js/html/css and our client side api. These widgets are stored in the database and not on the file system. I think it would be a big plus to allow them to create widgets as svelte components since it contains all of the markup, js and css in one location and would give them all of the benefits of svelte's reactivity. I have gotten as

How can I manually compile a svelte component down to the final javascript and css that sapper/svelte produces?

北城以北 提交于 2021-01-24 07:11:44
问题 Our company produces an automation framework that is written in svelte/sapper. One feature is that developers can create custom ui widgets, currently using plain js/html/css and our client side api. These widgets are stored in the database and not on the file system. I think it would be a big plus to allow them to create widgets as svelte components since it contains all of the markup, js and css in one location and would give them all of the benefits of svelte's reactivity. I have gotten as

How do I load an external JS library in Svelte/Sapper?

大憨熊 提交于 2021-01-21 08:35:27
问题 I have been trying to load the ace editor (https://ace.c9.io/) into my Sapper application. I had success loading it in the script tag when I loaded it in a Sapper route, but when I am trying to do the same in a Svelte component which is again rendered by a route I get the error: ace is not defined This is the code I have, which is working fine if it is a Sapper route: <div id="editor"> def main(): return sum(range(1,100)) </div> <script src="https://pagecdn.io/lib/ace/1.4.6/ace.js" type="text

Running svelte dev on server

时间秒杀一切 提交于 2021-01-05 11:29:19
问题 I am running svelte like this on my server: $ npm run dev Your application is ready~! 🚀 - Local: http://localhost:5000 ────────────────── LOGS ────────────────── Which is great. However, when I try to access through my public ip, the bundle is not found. I.E. When I type <publicIP>:5000 into the browser. It doesn't show up. The port is open and accessible. Is there any way to achieve this? The request just fails. But shouldn't it work if it's running on localhost:5000? I have set up a node

Running svelte dev on server

为君一笑 提交于 2021-01-05 11:28:58
问题 I am running svelte like this on my server: $ npm run dev Your application is ready~! 🚀 - Local: http://localhost:5000 ────────────────── LOGS ────────────────── Which is great. However, when I try to access through my public ip, the bundle is not found. I.E. When I type <publicIP>:5000 into the browser. It doesn't show up. The port is open and accessible. Is there any way to achieve this? The request just fails. But shouldn't it work if it's running on localhost:5000? I have set up a node

Cannot find module './App.svelte' or its corresponding type declarations

不问归期 提交于 2021-01-04 06:56:07
问题 I have a setup that integrates electron with svelte along with typescript support. when I run the rollup script to compile svelte app, i am getting cannot find module ./App.svelte error as shown below. Plugin typescript: @rollup/plugin-typescript TS2307: Cannot find module './App.svelte' or its corresponding type declarations. Here's my package.json configuration : { "name": "tapwire-electron-first", "productName": "tapwire-electron-first", "version": "1.0.0", "description": "My Electron