monorepo 에서 사용되는 라이브러리는 번들 시, 어떻게 dependency로 잡히나?
return withNx({
nx: {
// Set this to true if you would like to to use SVGR
// See: https://github.com/gregberge/svgr
svgr: false,
},
compiler: {
styledComponents: true,
},
experimental: {
esmExternals: false,
},
webpack(config) {
config.plugins.push(
new webpack.DefinePlugin({
...env,
})
);
-
위와 같이 withNx 플러그인 사용하여 node_modules 처럼 처리해주는게 아닐까 생각한다.
-
그러면 트리쉐이킹도 될까?
- 각 라이브러리마다 side effect 설정 및 웹팩 설정해주면 되지 않을까?