mistlog / svelte-draft-template Goto Github PK
View Code? Open in Web Editor NEWDevelop svelte app in typedraft/typescript
License: MIT License
Develop svelte app in typedraft/typescript
License: MIT License
There is a race condition on first run. App.svelte
cannot be resolved on first run of the dev
script, yet can be resolved on the second run (or upon saving App.tsx
). I guess this is because main.js
refers to App.Svelte
, yet TypeScript hasn't transpiled App.tsx
to App.svelte
yet.
git clone https://github.com/mistlog/svelte-draft-template.git
cd svelte-draft-template
npm install
dev
script for the first time ❌npm run dev
> [email protected] dev /Users/jwork/Documents/git/svelte-draft-template
> concurrently "npm run transcribe:watch" "rollup -c -w"
[0]
[0] > [email protected] transcribe:watch /Users/jwork/Documents/git/svelte-draft-template
[0] > sd ./src -w
[0]
[1] rollup v1.30.1
[1] bundles src/main.js → public/build/bundle.js...
[1] [!] Error: Could not resolve './App.svelte' from src/main.js
[1] Error: Could not resolve './App.svelte' from src/main.js
[1] at error (/Users/jwork/Documents/git/svelte-draft-template/node_modules/rollup/dist/shared/node-entry.js:5400:30)
[1] at ModuleLoader.handleResolveId (/Users/jwork/Documents/git/svelte-draft-template/node_modules/rollup/dist/shared/node-entry.js:12389:24)
[1] at ModuleLoader.<anonymous> (/Users/jwork/Documents/git/svelte-draft-template/node_modules/rollup/dist/shared/node-entry.js:12277:30)
[1] at Generator.next (<anonymous>)
[1] at fulfilled (/Users/jwork/Documents/git/svelte-draft-template/node_modules/rollup/dist/shared/node-entry.js:38:28)
[1]
transcribe:watch
script subsequently ✅npm run transcribe:watch
> [email protected] transcribe:watch /Users/jwork/Documents/git/svelte-draft-template
> sd ./src -w
rollup -c -w
script subsequently ✅node_modules/.bin/rollup -c -w
Your application is ready~! 🚀
- Local: http://localhost:5000
────────────────── LOGS ──────────────────
[15:46:23] 200 ─ 4.33ms ─ /
[15:46:23] 200 ─ 1.63ms ─ /global.css
[15:46:23] 200 ─ 1.44ms ─ /build/bundle.css
[15:46:23] 200 ─ 1.78ms ─ /build/bundle.js
[15:46:23] 200 ─ 14.93ms ─ /favicon.png
dev
script subsequently once more ✅npm run dev
Your application is ready~! 🚀
- Local: http://localhost:5000
────────────────── LOGS ──────────────────
[15:46:23] 200 ─ 4.33ms ─ /
[15:46:23] 200 ─ 1.63ms ─ /global.css
[15:46:23] 200 ─ 1.44ms ─ /build/bundle.css
[15:46:23] 200 ─ 1.78ms ─ /build/bundle.js
[15:46:23] 200 ─ 14.93ms ─ /favicon.png
In Webpack, in each rule, it is possible to provide an array of loaders to define an ordered pipeline by which to process files during the bundling process. It is quite common to process from SCSS -> CSS before bundling, for example. I'm sure Rollup will have an equivalent API allowing the TypeScript Compiler (or Babel) to be used to watch .tsx
files and process them to .svelte
files (ideally without emitting them to disk) without having to deal with a race condition between rollup and TypeScript. What do you think about this approach?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.