Created
September 2, 2021 13:47
-
-
Save kdembler/0706873c0e0655f923610d811f4d9ecd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { babel } from '@rollup/plugin-babel' | |
import graphql from '@rollup/plugin-graphql' | |
import inject from '@rollup/plugin-inject' | |
import reactRefresh from '@vitejs/plugin-react-refresh' | |
import path from 'path' | |
import { visualizer } from 'rollup-plugin-visualizer' | |
import { defineConfig } from 'vite' | |
// https://vitejs.dev/config/ | |
export default defineConfig({ | |
plugins: [ | |
reactRefresh(), | |
babel({ | |
extensions: ['.tsx', '.ts'], | |
include: ['src/**/*.style.*', 'src/**/*.styles.*'], | |
plugins: ['@emotion'], | |
compact: false, | |
babelHelpers: 'bundled', | |
}), | |
graphql(), | |
{ | |
...inject({ | |
include: ['node_modules/**/*.js*'], | |
modules: { | |
Buffer: ['buffer', 'Buffer'], | |
}, | |
}), | |
enforce: 'post', | |
}, | |
{ | |
...visualizer({ | |
filename: 'dist/stats.html', | |
}), | |
enforce: 'post', | |
}, | |
], | |
resolve: { | |
alias: { | |
'@': path.resolve(__dirname, './src'), | |
}, | |
}, | |
optimizeDeps: { | |
include: ['buffer'], | |
}, | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment