Comparing version 1.1.2 to 1.1.3
17
index.js
@@ -90,3 +90,3 @@ #!/usr/bin/env node | ||
// We'll actually do something – require deps | ||
const imports = require('rewrite-imports'); | ||
const { rewrite } = require('rewrite-imports'); | ||
const { mkdir } = require('mk-dirs/sync'); | ||
@@ -132,11 +132,8 @@ const { minify } = require('terser'); | ||
let CJS = imports(ESM) | ||
.replace(/(^|\s|;)export default/, '$1module.exports =') | ||
.replace(/(^|\s|;)export (const|(?:async )?function|class|let|var) (.+?)(?=(\(|\s|\=))/gi, (_, x, type, name) => { | ||
return keys.push(name) && `${x}${type} ${name}`; | ||
}) | ||
.replace(/(^|\s|;)export \{(.+?)}(?=(;|\s|$))/, (_, x, names) => { | ||
names.split(',').forEach(name => keys.push(name.trim())); | ||
return x; | ||
}); | ||
let CJS = rewrite(ESM).replace(/(^|;\s*|\r?\n+)export(?:\s*{([^}]*)}(?:(?:;|\s|$)))?( default)?(?: (const|(?:async )?function|class|let|var)\s+([a-z$_][\w$]*))?(?=([^"'`]*["'`][^"'`]*["'`])*[^"'`]*$)/gi, (raw, ws, names, def, type, name) => { | ||
if (def) return ws + 'module.exports ='; | ||
if (type) return keys.push(name) && `${ws}${type} ${name}`; | ||
names.split(',').forEach(name => keys.push(name.trim())); | ||
return ws; | ||
}); | ||
@@ -143,0 +140,0 @@ if (keys.length > 0) { |
{ | ||
"name": "bundt", | ||
"version": "1.1.2", | ||
"version": "1.1.3", | ||
"repository": "lukeed/bundt", | ||
@@ -33,9 +33,9 @@ "description": "A simple bundler for your delcious modules~!", | ||
"mk-dirs": "^3.0.0", | ||
"rewrite-imports": "^2.0.0", | ||
"rewrite-imports": "^3.0.0", | ||
"terser": "^4.8.0" | ||
}, | ||
"devDependencies": { | ||
"premove": "^3.0.0", | ||
"uvu": "^0.5.0" | ||
"premove": "3.0.1", | ||
"uvu": "0.5.1" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12109
161
+ Addedrewrite-imports@3.0.0(transitive)
- Removedrewrite-imports@2.0.3(transitive)
Updatedrewrite-imports@^3.0.0