Giter Club home page Giter Club logo

svelte-typescript-setups's People

Contributors

codechips avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

svelte-typescript-setups's Issues

On Windows, only Snowpack example works

svelte-vite-typescript on 'start' throws:

svelte-check found 0 errors, 0 warnings and 0 hints

warn - You have enabled experimental features: uniformColorPalette, extendedFontSizeScale, applyComplexClasses
warn - Experimental features are not covered by semver, may introduce breaking changes, and can change at any time.
[vite] Failed to resolve module import "svelte-inline-svg/src/index.js". (imported by /src/Wisdom.svelte)
[vite] Failed to resolve module import "svelte-inline-svg/src/index.js". (imported by /src/Wisdom.svelte)
[vite] Failed to resolve module import "svelte-inline-svg/src/index.js". (imported by /src/Wisdom.svelte)
[vite] Failed to resolve module import "svelte-inline-svg/src/index.js". (imported by /src/Wisdom.svelte)

image

svite example also does now work.

[Help] How to use vite to svelte build?

Describe the bug

I want to combine svelte and vite, their performance is so amazing, but when I run yarn build, I encountered some errors.

Reproduction

this is my vite.config.ts:

import { defineConfig } from 'vite'
import svelte from 'rollup-plugin-svelte-hot'
import sveltePreprocess from 'svelte-preprocess'

// https://vitejs.dev/config/
export default defineConfig({
	plugins: [
		svelte({
			preprocess: sveltePreprocess()
		})
	]
})

this is my script:

"scripts": {
    "dev": "vite",
    "build": "vite build",
    "serve": "vite preview",
    "format": "prettier --write \"./**/*.ts\" \"./**/*.svelte\" "
  },

when I run yarn build ,I get these error info:

$ vite build
building for production...
[svelte-preprocess] The file  "/src/main.ts" was not found.
[svelte] Cannot find module './transformers/module'
.....

detail info in Logs๐Ÿ‘‡

And this my repository : https://github.com/xieyezi/vite-vue3-react-svelte-todo-app/tree/main/packages/svelte-todo

System Info

  • vite version: ^2.0.0-beta.50
  • Operating System: Mac Os Catalina 10.15.7
  • Node version: v15.2.1
  • Package manager (npm/yarn/pnpm) and version: yarn 1.22.10

Logs

yarn run v1.22.10
$ vite build --debug
  vite:config bundled config file loaded in 109ms +0ms
  vite:config using resolved config: {
  vite:config   plugins: [
  vite:config     'alias',
  vite:config     'vite:dynamic-import-polyfill',
  vite:config     'vite:resolve',
  vite:config     'vite:html',
  vite:config     'vite:css',
  vite:config     'vite:esbuild',
  vite:config     'vite:json',
  vite:config     'vite:wasm',
  vite:config     'vite:worker',
  vite:config     'vite:asset',
  vite:config     'svelte',
  vite:config     'vite:css-post',
  vite:config     'vite:build-html',
  vite:config     'commonjs',
  vite:config     'vite:data-uri',
  vite:config     'vite:define',
  vite:config     'rollup-plugin-dynamic-import-variables',
  vite:config     'vite:import-analysis',
  vite:config     'vite:esbuild-transpile',
  vite:config     'vite:terser',
  vite:config     'vite:size'
  vite:config   ],
  vite:config   build: {
  vite:config     target: [ 'es2019', 'edge16', 'firefox60', 'chrome61', 'safari11' ],
  vite:config     polyfillDynamicImport: true,
  vite:config     outDir: 'dist',
  vite:config     assetsDir: 'assets',
  vite:config     assetsInlineLimit: 4096,
  vite:config     cssCodeSplit: true,
  vite:config     sourcemap: false,
  vite:config     rollupOptions: {},
  vite:config     commonjsOptions: { include: [Array], extensions: [Array] },
  vite:config     minify: 'terser',
  vite:config     terserOptions: {},
  vite:config     cleanCssOptions: {},
  vite:config     write: true,
  vite:config     emptyOutDir: null,
  vite:config     manifest: false,
  vite:config     lib: false,
  vite:config     ssr: false,
  vite:config     ssrManifest: false
  vite:config   },
  vite:config   configFile: '/Users/xieyezi/myself/vite-vue3-react-svelte-todo/packages/svelte-todo/vite.config.ts',
  vite:config   inlineConfig: {
  vite:config     root: undefined,
  vite:config     base: undefined,
  vite:config     mode: undefined,
  vite:config     configFile: undefined,
  vite:config     logLevel: undefined,
  vite:config     clearScreen: undefined,
  vite:config     build: {}
  vite:config   },
  vite:config   root: '/Users/xieyezi/myself/vite-vue3-react-svelte-todo/packages/svelte-todo',
  vite:config   command: 'build',
  vite:config   mode: 'production',
  vite:config   isProduction: true,
  vite:config   optimizeCacheDir: '/Users/xieyezi/myself/vite-vue3-react-svelte-todo/packages/svelte-todo/node_modules/.vite',
  vite:config   alias: [
  vite:config     {
  vite:config       find: /^\/@vite\//,
  vite:config       replacement: '/Users/xieyezi/myself/vite-vue3-react-svelte-todo/node_modules/vite/dist/client/'
  vite:config     }
  vite:config   ],
  vite:config   server: {},
  vite:config   env: { BASE_URL: '/', MODE: 'production', DEV: false, PROD: true },
  vite:config   assetsInclude: [Function: assetsInclude],
  vite:config   logger: {
  vite:config     hasWarned: false,
  vite:config     info: [Function: info],
  vite:config     warn: [Function: warn],
  vite:config     error: [Function: error],
  vite:config     clearScreen: [Function: clearScreen]
  vite:config   },
  vite:config   base: '/'
  vite:config } +4ms
building for production...
[svelte-preprocess] The file  "/src/main.ts" was not found.
[svelte] Cannot find module './transformers/module'
Require stack:
- /Users/xieyezi/myself/vite-vue3-react-svelte-todo/node_modules/svelte-preprocess/dist/autoProcess.js
- /Users/xieyezi/myself/vite-vue3-react-svelte-todo/node_modules/svelte-preprocess/dist/index.js
- /Users/xieyezi/myself/vite-vue3-react-svelte-todo/packages/svelte-todo/vite.config.ts
- /Users/xieyezi/myself/vite-vue3-react-svelte-todo/node_modules/vite/dist/node/chunks/dep-19255ed7.js
- /Users/xieyezi/myself/vite-vue3-react-svelte-todo/node_modules/vite/dist/node/cli.js
- /Users/xieyezi/myself/vite-vue3-react-svelte-todo/node_modules/vite/bin/vite.js
file: /Users/xieyezi/myself/vite-vue3-react-svelte-todo/packages/svelte-todo/index.html
error during build:
Error: Cannot find module './transformers/module'
Require stack:
- /Users/xieyezi/myself/vite-vue3-react-svelte-todo/node_modules/svelte-preprocess/dist/autoProcess.js
- /Users/xieyezi/myself/vite-vue3-react-svelte-todo/node_modules/svelte-preprocess/dist/index.js
- /Users/xieyezi/myself/vite-vue3-react-svelte-todo/packages/svelte-todo/vite.config.ts
- /Users/xieyezi/myself/vite-vue3-react-svelte-todo/node_modules/vite/dist/node/chunks/dep-19255ed7.js
- /Users/xieyezi/myself/vite-vue3-react-svelte-todo/node_modules/vite/dist/node/cli.js
- /Users/xieyezi/myself/vite-vue3-react-svelte-todo/node_modules/vite/bin/vite.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:919:15)
    at Function.Module._load (node:internal/modules/cjs/loader:763:27)
    at Module.require (node:internal/modules/cjs/loader:991:19)
    at require (node:internal/modules/cjs/helpers:92:18)
    at /Users/xieyezi/myself/vite-vue3-react-svelte-todo/node_modules/svelte-preprocess/dist/autoProcess.js:36:77
    at async Object.exports.transform (/Users/xieyezi/myself/vite-vue3-react-svelte-todo/node_modules/svelte-preprocess/dist/autoProcess.js:36:29)
    at async /Users/xieyezi/myself/vite-vue3-react-svelte-todo/node_modules/svelte-preprocess/dist/autoProcess.js:96:29
    at async script (/Users/xieyezi/myself/vite-vue3-react-svelte-todo/node_modules/svelte-preprocess/dist/autoProcess.js:124:33)
    at async process_single_tag (/Users/xieyezi/myself/vite-vue3-react-svelte-todo/node_modules/svelte/compiler.js:28953:28)
    at async Promise.all (index 0)
error Command failed with exit code 1.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.