@flatjs/evolve 2.1.0-next.30 → 2.1.0-next.31
Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
|
|
1
|
-
import{requireResolve}from"@flatjs/common";import{mergeBabelOption}from"../../helpers/merge-babel-options.js";import{shouldEnableReactFastRefresh}from"../../helpers/should-enable-react-fast-refresh.js";export const ruleBabel=e=>({test:/\.(tsx|ts|js|jsx|mjs|cjs|mts|cts)$/,use:[{loader:requireResolve(import.meta.url,"babel-loader"),options:e}]});export const ruleScripts=(e,r,s)=>{const{babelOptions:t={},modularImports:o=[]}=s.loaderOptions,l=mergeBabelOption(o,t);return shouldEnableReactFastRefresh(e,r,s)&&(l.plugins?l.plugins.push(requireResolve(import.meta.url,"react-refresh/babel")):l.plugins=[requireResolve(import.meta.url,"react-refresh/babel")]),ruleBabel(l)};
|
1
|
+
import{requireResolve}from"@flatjs/common";import{mergeBabelOption}from"../../helpers/merge-babel-options.js";import{shouldEnableReactFastRefresh}from"../../helpers/should-enable-react-fast-refresh.js";export const ruleBabel=e=>({test:/\.(tsx|ts|js|jsx|mjs|cjs|mts|cts)$/,use:[{loader:requireResolve(import.meta.url,"babel-loader"),options:e}]});export const ruleScripts=(e,r,s)=>{const{babelOptions:t={},modularImports:o=[]}=s.loaderOptions,l=mergeBabelOption(e,o,t);return shouldEnableReactFastRefresh(e,r,s)&&(l.plugins?l.plugins.push(requireResolve(import.meta.url,"react-refresh/babel")):l.plugins=[requireResolve(import.meta.url,"react-refresh/babel")]),ruleBabel(l)};
|
@@ -1,4 +1,4 @@
|
|
1
1
|
import { type TransformOptions } from '@babel/core';
|
2
2
|
import { type BuiltinBabelOptions } from '../types/types-loader-options.js';
|
3
3
|
import { type ModularImportOption } from '../types/types-modular-import.js';
|
4
|
-
export declare const mergeBabelOption: (modularImports?: ModularImportOption[], options?: BuiltinBabelOptions) => TransformOptions;
|
4
|
+
export declare const mergeBabelOption: (serveMode: boolean, modularImports?: ModularImportOption[], options?: BuiltinBabelOptions) => TransformOptions;
|
@@ -1 +1 @@
|
|
1
|
-
import{babelMerge}from"@armit/babel-merge";import babelPluginImport from"@flatjs/babel-plugin-import";import{logger}from"@flatjs/common";import{reactBabelPreset,vueBabelPreset}from"@flatjs/evolve-preset-babel";import{moduleName}from"../constants.js";export const mergeBabelOption=(e=[],
|
1
|
+
import{babelMerge}from"@armit/babel-merge";import babelPluginImport from"@flatjs/babel-plugin-import";import{logger}from"@flatjs/common";import{reactBabelPreset,vueBabelPreset}from"@flatjs/evolve-preset-babel";import{moduleName}from"../constants.js";export const mergeBabelOption=(e,r=[],t={usePreset:"react"})=>{const a=r.map((e=>[babelPluginImport,{transformToDefaultImport:!1,libraryDirectory:"dist",...e},e.libraryName])),{usePreset:l="react",...o}=t,m="react"===l?reactBabelPreset(e):"vue"===l?vueBabelPreset():reactBabelPreset();let b={};try{b=babelMerge(m,o),b.plugins?b.plugins.unshift(...a):b.plugins=a}catch(e){logger.error(e,moduleName)}return{...b,babelrc:!1,compact:!1}};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@flatjs/evolve",
|
3
|
-
"version": "2.1.0-next.
|
3
|
+
"version": "2.1.0-next.31",
|
4
4
|
"license": "MIT",
|
5
5
|
"type": "module",
|
6
6
|
"exports": {
|
@@ -45,7 +45,7 @@
|
|
45
45
|
"@discoveryjs/json-ext": "0.6.0",
|
46
46
|
"@flatjs/babel-plugin-import": "2.1.0-next.10",
|
47
47
|
"@flatjs/common": "2.1.0-next.9",
|
48
|
-
"@flatjs/evolve-preset-babel": "2.1.0-next.
|
48
|
+
"@flatjs/evolve-preset-babel": "2.1.0-next.12",
|
49
49
|
"@flatjs/forge-postcss-plugin-pixel": "2.1.0-next.9",
|
50
50
|
"@flatjs/graph": "2.1.0-next.13",
|
51
51
|
"@flatjs/mock": "2.1.0-next.14",
|