Skip to content
This repository has been archived by the owner on Jun 25, 2024. It is now read-only.

Commit

Permalink
dev: import webgl-memory only when it's DEV mode
Browse files Browse the repository at this point in the history
  • Loading branch information
0b5vr committed Jul 17, 2022
1 parent 066b39d commit e276d4f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/dummy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default undefined;
7 changes: 7 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ const terserOptions: Terser.MinifyOptions = {

export default defineConfig( ( { mode } ) => {
return {
resolve: {
alias: {
...( mode === 'prod' ? {
'webgl-memory': `${ __dirname }/src/dummy.ts`, // don't want to import webgl-memory when it's prod build
} : {} ),
},
},
build: {
target: 'esnext',
minify: mode === 'prod' ? 'terser' : false,
Expand Down

0 comments on commit e276d4f

Please sign in to comment.