importBuild path #614
-
const importPathAbsolute = toPosixPath(
// [RELATIVE_PATH_FROM_DIST] Current file: node_modules/vite-plugin-ssr/dist/cjs/node/plugin/plugins/importBuild/index.js
require.resolve(`../../../../../../dist/cjs/node/plugin/plugins/importBuild/loadBuild.js`)
) const importPathAbsolute = toPosixPath(require.resolve(`./loadBuild`)) QuestionWhy do we resolve |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Because we sometimes need to target Out of habit I always resolve starting from |
Beta Was this translation helpful? Give feedback.
Because we sometimes need to target
dist/esm/
instead ofdist/cjs/
, for example: https://github.com/brillout/vite-plugin-ssr/blob/09b2b967e3d1f969c2fadc52f37f6b6626f11ed0/vite-plugin-ssr/node/plugin/plugins/buildConfig.ts#L55-L56Out of habit I always resolve starting from
dist/
. But, yea, I think forloadBuild.js
we could indeed directlyrequire.resolve('./loadBuild.js')
instead. PR welcome, if you want.