Created
June 13, 2021 20:06
-
-
Save hasangenc0/4a714ba88fc7b7a18bf3a75f4019ffd9 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
const externals = { | |
react: 'React', | |
'react-dom': 'ReactDOM', | |
axios: 'axios', | |
}; | |
export default defineConfig({ | |
... | |
build: { | |
rollupOptions: { | |
external: Object.keys(externals), | |
... | |
}, | |
commonjsOptions: { | |
ignore: Object.keys(externals), | |
esmExternals: Object.keys(externals), | |
}, | |
... | |
}, | |
optimizeDeps: { | |
exclude: Object.keys(externals), // optional, just excludes for pre-bundling | |
}, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment