From 7fa0bc5f9906c46e2376a069834155d1dff42e4c Mon Sep 17 00:00:00 2001 From: Dominik Piatek Date: Thu, 21 Sep 2023 13:36:34 +0100 Subject: [PATCH] Silence Vite warnings about node packages loaded by postcss See https://github.com/vitejs/vite/issues/9200 --- demo/noop.js | 2 ++ demo/vite.config.ts | 10 ++++++++++ 2 files changed, 12 insertions(+) create mode 100644 demo/noop.js diff --git a/demo/noop.js b/demo/noop.js new file mode 100644 index 00000000..834ecd2d --- /dev/null +++ b/demo/noop.js @@ -0,0 +1,2 @@ +// See https://github.com/vitejs/vite/issues/9200 +module.exports = {}; diff --git a/demo/vite.config.ts b/demo/vite.config.ts index 33d7e5b2..e5ac0646 100644 --- a/demo/vite.config.ts +++ b/demo/vite.config.ts @@ -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,