Skip to content

Commit

Permalink
Create manual chunks and enable sourcemaps
Browse files Browse the repository at this point in the history
  • Loading branch information
WRadoslaw committed Aug 7, 2023
1 parent 85e85fc commit 09b7d4d
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion packages/atlas/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,34 @@ export default defineConfig(({ mode }) => {
return {
root: './src',
build: {
sourcemap: false,
target: ['chrome87', 'edge88', 'es2020', 'firefox78', 'safari14'],
emptyOutDir: true,
outDir: path.resolve(__dirname, 'dist'),
rollupOptions: {
output: {
sourcemap: true,
sourcemapIgnoreList: (relativeSourcePath) => {
// will ignore-list all files with node_modules in their paths
return relativeSourcePath.includes('node_modules')
},
manualChunks: {
'react-lottie-player': ['@lottiefiles/react-lottie-player'],
'crypto-js': ['crypto-js'],
sentry: ['@sentry/react'],
'polkadot-utils': [
'@polkadot/util-crypto',
'@polkadot/types',
'@polkadot/keyring',
'@polkadot/api',
'@polkadot/util',
],
joystream: ['@joystream/metadata-protobuf', '@joystream/js/content', '@joystream/types'],
'video-js': ['video.js'],
animations: [path.resolve(__dirname, 'src/assets/animations')],
icons: [path.resolve(__dirname, 'src/assets/icons')],
illustrations: [path.resolve(__dirname, 'src/assets/illustrations')],
},
},
input: {
main: path.resolve(__dirname, 'src/index.html'),
embedded: path.resolve(__dirname, 'src/embedded/index.html'),
Expand Down

0 comments on commit 09b7d4d

Please sign in to comment.