esbuild-plugin-lodash
Advanced tools
Comparing version 1.0.3 to 1.0.4
@@ -0,1 +1,8 @@ | ||
## [1.0.4](https://github.com/josteph/esbuild-plugin-lodash/compare/1.0.3...1.0.4) (2021-06-26) | ||
### Bug Fixes | ||
* import lodash/last bug ([#1](https://github.com/josteph/esbuild-plugin-lodash/issues/1)) ([e91dff2](https://github.com/josteph/esbuild-plugin-lodash/commit/e91dff2c9f5559a16446bdfe1761e56bba1ac2b9)) | ||
## [1.0.3](https://github.com/josteph/esbuild-plugin-lodash/compare/1.0.2...1.0.3) (2021-05-16) | ||
@@ -2,0 +9,0 @@ |
12
index.js
@@ -50,11 +50,5 @@ const fs = require('fs'); | ||
const previousResult = `${result ? `${result}\n` : ''}`; | ||
if (name.includes('as')) { | ||
const realImportName = name.split(' as '); | ||
if (realImportName.length !== 2) { | ||
return; | ||
} | ||
result = `${previousResult}import ${realImportName[1]} from 'lodash/${realImportName[0]}';`; | ||
if (name.includes(' as ')) { | ||
const [realName, alias] = name.split(' as '); | ||
result = `${previousResult}import ${alias} from 'lodash/${realName}';`; | ||
} else { | ||
@@ -61,0 +55,0 @@ result = `${previousResult}import ${name} from 'lodash/${name}';`; |
{ | ||
"name": "esbuild-plugin-lodash", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "Similar babel-plugin-lodash for esbuild", | ||
@@ -5,0 +5,0 @@ "author": "Joshua Stephen (https://github.com/josteph)", |
6936
56