From 121b83311d579838d4f3f5158f147e7f0d000577 Mon Sep 17 00:00:00 2001 From: ajuner <106791576@qq.com> Date: Mon, 28 Jun 2021 15:02:57 +0800 Subject: [PATCH] fix: ignore vite module --- package.json | 2 +- src/index.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index f2a6296..c18945c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vite-plugin-importer", - "version": "0.2.3", + "version": "0.2.4", "main": "src/index.js", "description": "Integration for babel-plugin-import", "author": "ajuner", diff --git a/src/index.js b/src/index.js index 82b6ce1..ace92df 100644 --- a/src/index.js +++ b/src/index.js @@ -9,7 +9,7 @@ function usePluginImport(options) { transform(code, id) { - if (/\.(?:[jt]sx?|vue)$/.test(id)) { + if (/\.(?:[jt]sx?|vue)$/.test(id) && !/node_modules\/vite/.test(id)) { const plugins = [importMeta, [babelImport, options]] const result = babel.transformSync(code, {