Skip to content

Commit

Permalink
Silence Vite warnings about node packages loaded by postcss
Browse files Browse the repository at this point in the history
  • Loading branch information
Dominik Piatek authored and dpiatek committed Sep 25, 2023
1 parent b882b4a commit 07ea278
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions demo/noop.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// See https://github.com/vitejs/vite/issues/9200
module.exports = {};
10 changes: 10 additions & 0 deletions demo/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@ import react from '@vitejs/plugin-react';

// https://vitejs.dev/config/
export default defineConfig({
resolve: {
alias: {
// Silence Vite warnings about node packages loaded by postcss
// See https://github.com/vitejs/vite/issues/9200
path: './noop.js',
fs: './noop.js',
url: './noop.js',
'source-map-js': './noop.js',
},
},
plugins: [react()],
server: {
port: 8080,
Expand Down

0 comments on commit 07ea278

Please sign in to comment.