Package Exports
- @brillout/vite-plugin-import-build
- @brillout/vite-plugin-import-build/index.js
- @brillout/vite-plugin-import-build/plugin
- @brillout/vite-plugin-import-build/plugin.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@brillout/vite-plugin-import-build) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Automatically load your server build (i.e. your server files built at dist/server/, or ${build.outDir}/server if you use vite.config.js#build.outDir).
It does so in an universal and portable way. (I.e. it works with every known environment such as Edge Deployments and Yarn PnP.)
importBuild.cjs
Usually, @brillout/vite-plugin-import-build does everything automagically and you don't have to do anything.
But, in some environments, you need to help @brillout/vite-plugin-import-build by adding the following to your server code:
// server.js
// Load server files built at dist/server/
import './path/to/dist/server/importBuild.cjs'
// Your server code (e.g. Express.js, Vercel Serverless/Edge, Cloudflare Worker, ...)
// ...If you use vite.config.js > build.outDir, then replace the path ./path/to/dist/server/importBuild.cjs with the path of your custom location ./path/to/${build.outDir}/server/importBuild.cjs.
See https://github.com/brillout/vite-plugin-import-build/issues/4 to learn more about importBuild.cjs and why/when you need to import it manually.