TheComputerM / svelte-materialify

A Material UI Design Component library for Svelte heavily inspired by vuetify.
https://svelte-materialify.vercel.app
MIT License
622 stars 83 forks source link

Can not use SM with Vite & @svitejs/vite-plugin-svelte in dev environment #191

Closed ghost closed 3 years ago

ghost commented 3 years ago

If I import svelte-maretialify library I got the error in Chrome:

Slider.svelte:1

Uncaught SyntaxError: The requested module '/node_modules/svelte-materialify/dist/components/Slider/nouislider.min.js' does not provide an export named 'default'

In production build anything is ok

tsconfig.json:

{
    "extends": "@tsconfig/svelte/tsconfig.json",
    "include": ["src/**/*"],
    "exclude": ["node_modules/*", "__sapper__/*", "public/*"],
    "compilerOptions": {
        "target": "esnext",
        "module": "esnext",
        "moduleResolution": "node",
        "strict": true,
        "jsx": "preserve",
        "sourceMap": true,
        "resolveJsonModule": true,
        "esModuleInterop": true,
        "lib": ["esnext", "dom"],
        "types": ["svelte", "vite/client"],
        "baseUrl": ".",
        "paths": {
            "@/*": ["src/*"]
        }
    }
}

svelte.config.js:

const autoPreprocess = require('svelte-preprocess')

module.exports = {
    preprocess: autoPreprocess({
        defaults: {
            script: 'typescript',
        },
        postcss: true,
    }),
}
Florian-Schoenherr commented 3 years ago

See #171