File tree Expand file tree Collapse file tree 1 file changed +13
-13
lines changed Expand file tree Collapse file tree 1 file changed +13
-13
lines changed Original file line number Diff line number Diff line change @@ -79,7 +79,6 @@ export async function resolveInputOptions(
7979 dts,
8080 unused,
8181 target,
82- define,
8382 shims,
8483 tsconfig,
8584 cwd,
@@ -152,6 +151,17 @@ export async function resolveInputOptions(
152151 plugins . push ( userPlugins )
153152 }
154153
154+ const define = {
155+ ...config . define ,
156+ ...Object . keys ( env ) . reduce ( ( acc , key ) => {
157+ const value = JSON . stringify ( env [ key ] )
158+ acc [ `process.env.${ key } ` ] = value
159+ acc [ `import.meta.env.${ key } ` ] = value
160+ return acc
161+ } , Object . create ( null ) ) ,
162+ }
163+ const inject = shims && ! cjsDts ? getShimsInject ( format , platform ) : undefined
164+
155165 const inputOptions = await mergeUserOptions (
156166 {
157167 input : entry ,
@@ -165,18 +175,8 @@ export async function resolveInputOptions(
165175 platform : cjsDts || format === 'cjs' ? 'node' : platform ,
166176 transform : {
167177 target,
168- define : {
169- ...define ,
170- ...Object . keys ( env ) . reduce ( ( acc , key ) => {
171- const value = JSON . stringify ( env [ key ] )
172- acc [ `process.env.${ key } ` ] = value
173- acc [ `import.meta.env.${ key } ` ] = value
174- return acc
175- } , Object . create ( null ) ) ,
176- } ,
177- inject : {
178- ...( shims && ! cjsDts && getShimsInject ( format , platform ) ) ,
179- } ,
178+ define,
179+ inject,
180180 } ,
181181 plugins,
182182 moduleTypes : loader ,
You can’t perform that action at this time.
0 commit comments