question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[examples] Add example demo with vite

See original GitHub issue

Hope to support vite…

Related issues:

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:53
  • Comments:43 (12 by maintainers)

github_iconTop GitHub Comments

15reactions
heyheman11commented, Oct 11, 2021

For those struggling with this issue, it still exists for mui/material-icons. The following config resolved my issue. Based on others answers

import { defineConfig } from "vite";
import reactRefresh from "@vitejs/plugin-react-refresh";

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [reactRefresh()],
  resolve: {
    alias: [
      {
        find: /^@mui\/icons-material\/(.*)/,
        replacement: "@mui/icons-material/esm/$1"
      }
    ]
  }
});
11reactions
oliviertassinaricommented, May 8, 2021

Adding this config: vite.config.js

import { defineConfig } from 'vite'

export default defineConfig({
  resolve: {
    alias: {
      '@material-ui/icons': '@material-ui/icons/esm',
    },
  },
})

Seems to solve the issue. At least, it fixes the reproduction that @Mushus has given in #25362 with v4 and v5.

Can people confirm? (from https://github.com/vitejs/vite/issues/1853#issuecomment-793026832) Or infirm with a reproduction.

If it solves the issue, would somebody be interested in adding a vite example inside this folder: /examples 😃?

Read more comments on GitHub >

github_iconTop Results From Across the Web

[examples] Add example demo with vite · Issue #21377 - GitHub
Material-UI, as any other dependency, should just work by npm install ing it and import ing it.
Read more >
Getting Started - Vite
A dev server that provides rich feature enhancements over native ES modules, for example extremely fast Hot Module Replacement (HMR). · A build...
Read more >
Vite - Vue.js Examples
Template for symfony that uses Vite, Inertia and VueJs 3. 15 August 2022 ; A Vite plugin for creating and injecting favicons during...
Read more >
How to set up a Front-End project with Vite, React, and ...
npm init vite@latest demo-project -- --template react-ts ... For setting up ESLint we need to install it and add a configuration file with ......
Read more >
Build a JavaScript library with multiple entry points using Vite3
Luckily Vite has something called "Library Mode", which allows us to point to an entry file (like a index.ts file that exports everything...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found