@alita/autoimport
Advanced tools
Comparing version 3.0.0 to 3.0.1
@@ -69,3 +69,3 @@ "use strict"; | ||
const { file } = state; | ||
if (!checkPathFilename(file)) | ||
if (!checkPathFilename(file?.opts?.filename)) | ||
return; | ||
@@ -127,3 +127,3 @@ const { name } = path.node; | ||
const { file } = state; | ||
if (!checkPathFilename(file)) | ||
if (!checkPathFilename(file?.opts?.filename)) | ||
return; | ||
@@ -130,0 +130,0 @@ const { object, property } = path.node; |
@@ -5,3 +5,3 @@ "use strict"; | ||
// - https://github.com/antfu/unplugin-auto-import | ||
// - https://github.com/umijs/umi/packages/preset-umi/src/features/lowImport/lowImport.ts | ||
// - https://github.com/umijs/umi/packages/preset-umi/src/features/autoImport/autoImport.ts | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
@@ -33,3 +33,3 @@ return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
api.modifyAppData(async (memo) => { | ||
memo.lowImport = [ | ||
memo.autoImport = [ | ||
await api.applyPlugins({ | ||
@@ -39,3 +39,3 @@ key: 'addLowImportLibs', | ||
}), | ||
...(api.config.lowImport.libs || []), | ||
...(api.config.autoImport.libs || []), | ||
]; | ||
@@ -45,3 +45,3 @@ }); | ||
// generate dts | ||
const dts = api.appData.lowImport.map((lib) => { | ||
const dts = api.appData.autoImport.map((lib) => { | ||
if (lib.withObj) { | ||
@@ -72,7 +72,7 @@ const memberDts = (lib.members || []) | ||
`.trim() + `\n`; | ||
(0, fs_1.writeFileSync)((0, path_1.join)(api.paths.cwd, 'lowImport.d.ts'), content, 'utf-8'); | ||
(0, fs_1.writeFileSync)((0, path_1.join)(api.paths.cwd, 'autoImport.d.ts'), content, 'utf-8'); | ||
}); | ||
api.addBeforeBabelPresets(() => { | ||
const opts = normalizeLibs(api.appData.lowImport); | ||
const css = api.config.lowImport?.css || 'less'; | ||
const opts = normalizeLibs(api.appData.autoImport); | ||
const css = api.config.autoImport?.css || 'less'; | ||
return [ | ||
@@ -79,0 +79,0 @@ { |
{ | ||
"name": "@alita/autoimport", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"description": "@alita/autoimport", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
13727