Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create separate @blitzjs/webpack package for node context #861

Closed
ryardley opened this issue Mar 4, 2020 · 0 comments · Fixed by blitz-js/blitz#42
Closed

Create separate @blitzjs/webpack package for node context #861

ryardley opened this issue Mar 4, 2020 · 0 comments · Fixed by blitz-js/blitz#42

Comments

@ryardley
Copy link
Contributor

ryardley commented Mar 4, 2020

Currently from the same package we are exporting code that runs:

  • Within a node context. (webpack config)
  • Within an isomorphic JSX / React context.

Because of the nature of JS when modules are loaded they are also run. Unfortunately that means stuff breaks when it is in the wrong context.

For example, in order to allow our users to import using absolute paths such as. app/posts/controllers, if I try and add a node using plugin such as tsconfig-paths-webpack-plugin to withBlitz function export of @blitzjs/core , we get an error because that webpack code is included with the other exports from that package that are run in the wrong "non-node" context.

This means we need to deep link to the node stuff by itself perhaps or create a new package like @blitzjs/webpack.

We could alternatively try to create a custom rollup config to not concatenate files which would allow for @blitzjs/core/webpack but I think that would be much harder than just making a new package mainly because tsdx doesn't support it.

If no one objects I might make a new package?

@ryardley ryardley changed the title Create separate package for separate code contexts Create separate @blitzjs/webpack package for node context Mar 4, 2020
@dillondotzip dillondotzip transferred this issue from blitz-js/blitz Jul 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant