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
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?
The text was updated successfully, but these errors were encountered:
ryardley
changed the title
Create separate package for separate code contexts
Create separate @blitzjs/webpack package for node context
Mar 4, 2020
Currently from the same package we are exporting code that runs:
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 astsconfig-paths-webpack-plugin
towithBlitz
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?
The text was updated successfully, but these errors were encountered: