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, the logic to replace SECURITY_NAMESPACE based on the contents of the file it points to (if it points to a file) is just top-level code in the @paima/build-utils code
It may be useful to export these settings in a more easy-to-consume way for projects that want to bypass the standard Paima build system and instead hook into their own esbuild process.
Notably for Vite, it uses esbuild (but only in dev builds - production builds use @rollup/plugin-commonjs). We can't just do something simple like import esbuildConfigs from '@paima/build-utils/middleware-esbuildconfig.template'; because of ES module import hoisting (we can require instead, or if we have a vite plugin for Paima we can ensure proper ordering there)
Therefore, there are two steps to this:
Figure out how we can export the esbuild template configs in a way Vite can use for dev builds
Figure out how we can export the SECURITY_NAMESPACE_ROUTER computation in a way that works with rollup
Given that SECURITY_NAMESPACE_ROUTER is a rare feature to actually need, I'm leaving this open for now
I should at that with this we should also be able to delete the npx paima-build-middleware building in the vite templates since it won't be needed anymore (it's already unused, but strictly speaking the SECURITY_NAMESPACE_ROUTER only works there for now if you really needed it)
The text was updated successfully, but these errors were encountered:
Currently, the logic to replace
SECURITY_NAMESPACE
based on the contents of the file it points to (if it points to a file) is just top-level code in the@paima/build-utils
codeIt may be useful to export these settings in a more easy-to-consume way for projects that want to bypass the standard Paima build system and instead hook into their own esbuild process.
Notably for Vite, it uses esbuild (but only in dev builds - production builds use
@rollup/plugin-commonjs
). We can't just do something simple likeimport esbuildConfigs from '@paima/build-utils/middleware-esbuildconfig.template';
because of ES module import hoisting (we canrequire
instead, or if we have avite
plugin for Paima we can ensure proper ordering there)Therefore, there are two steps to this:
SECURITY_NAMESPACE_ROUTER
computation in a way that works with rollupGiven that
SECURITY_NAMESPACE_ROUTER
is a rare feature to actually need, I'm leaving this open for nowI should at that with this we should also be able to delete the
npx paima-build-middleware
building in the vite templates since it won't be needed anymore (it's already unused, but strictly speaking theSECURITY_NAMESPACE_ROUTER
only works there for now if you really needed it)The text was updated successfully, but these errors were encountered: