You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to create an internal package in a turborepo project. The shared package follows the same setup as the example, and it works as is in the Vite frontend project. However, when importing that module to the backend (Nest + SWC) the dev script fails Unexpected token 'export'
The built main.js file is trying to require from the shared package, but it's only a typescript file (as in the example). All the examples and other issues are using Next.js, which has a transpilePackages
config option that does exactly what I'm trying to achieve. Is there an alternative to transpilePackages that works with SWC?
Things I've tried:
including the shared package in tsconfig.json
including it in webpack.config.js
(changing the exclude pattern of swc-loader
to include that folder from node_modules), like this:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm trying to create an internal package in a turborepo project. The shared package follows the same setup as the example, and it works as is in the Vite frontend project. However, when importing that module to the backend (Nest + SWC) the dev script fails Unexpected token 'export'
The built main.js file is trying to require from the shared package, but it's only a typescript file (as in the example). All the examples and other issues are using Next.js, which has a transpilePackages
config option that does exactly what I'm trying to achieve. Is there an alternative to transpilePackages that works with SWC?
Things I've tried:
including the shared package in tsconfig.json
including it in webpack.config.js
(changing the exclude pattern of swc-loader
to include that folder from node_modules), like this:
Beta Was this translation helpful? Give feedback.
All reactions