@flatjs/evolve 2.1.0-next.7 → 2.1.0-next.8
Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
|
|
1
|
-
import{join}from"path";import{mergeOptions}from"@flatjs/common";import{devReactFastRefresh}from"../constants.js";import{normalizeEvolveEntryName}from"./normalize-entry-map.js";export function splitToMultiCompilerConfigs(e,t,
|
1
|
+
import{dirname,join}from"path";import{searchPackageDir}from"@armit/package";import{mergeOptions,requireResolve}from"@flatjs/common";import{devReactFastRefresh}from"../constants.js";import{normalizeEvolveEntryName}from"./normalize-entry-map.js";export function splitToMultiCompilerConfigs(e,r,t,o=!1){const a=[];for(const[r,o]of Object.entries(e)){const e=normalizeEvolveEntryName(r,t.projectVirtualPath);a.push({[e]:o.entry})}return a.map((e=>{const t=Object.keys(e)[0];if(o){const r=join(t,devReactFastRefresh.reactRefreshSetup),o=requireResolve(import.meta.url,"@pmmmwh/react-refresh-webpack-plugin"),a=searchPackageDir({cwd:dirname(o)});if(!a)throw new Error("react-refresh-webpack-plugin package directory not found");e[r]=[join(a,"/client/ReactRefreshEntry.js")]}return mergeOptions(r,{name:t,entry:e})}))}
|