Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bundt

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bundt - npm Package Compare versions

Comparing version 1.0.2 to 1.1.0

22

index.js
#!/usr/bin/env node
const { gzipSync } = require('zlib');
const { dirname, normalize, resolve, join, extname } = require('path');
const { existsSync, readFileSync, writeFileSync } = require('fs');
const { dirname, normalize, resolve } = require('path');
const { white, red, cyan, dim } = require('kleur');

@@ -36,7 +36,11 @@

file = normalize(file);
if (toDir && toDir !== 'default') {
let isDef = /\.d\.ts$/.test(file);
if (isDef && toDir !== 'default') {
file = join(toDir, file);
} else if (toDir && toDir !== 'default') {
file = normalize(file.replace(dirname(file), toDir));
}
mkdirs(dirname(file)); // sync
let { code } = minify(data, Object.assign({ toplevel:!isUMD }, terser));
let code = isDef && data;
code = code || minify(data, Object.assign({ toplevel:!isUMD }, terser)).code;
writeFileSync(file, isUMD ? code : data);

@@ -117,2 +121,9 @@ let gzip = size(gzipSync(code).length);

let types = '';
if (isMode) {
let extn = extname(filepath);
types = filepath.replace(extn, '.d.ts');
types = existsSync(types) && readFileSync(types, 'utf8');
}
const keys = [];

@@ -126,2 +137,6 @@ const ESM = readFileSync(filepath, 'utf8');

return keys.push(name) && `${x}${type} ${name}`;
})
.replace(/(^|\s|;)export \{(.+?)}(?=(;|\s|$))/, (_, x, names) => {
names.split(',').forEach(name => keys.push(name.trim()));
return x;
});

@@ -146,2 +161,3 @@

fields.unpkg && write(fields.unpkg, UMD, isMin || 1, isMode),
types && write('index.d.ts', types, false, isMode),
].filter(Boolean)

@@ -148,0 +164,0 @@ ).then(arr => {

6

package.json
{
"name": "bundt",
"version": "1.0.2",
"version": "1.1.0",
"repository": "lukeed/bundt",

@@ -37,5 +37,5 @@ "description": "A simple bundler for your delcious modules~!",

"devDependencies": {
"premove": "^2.0.0",
"uvu": "^0.0.14"
"premove": "^3.0.0",
"uvu": "^0.3.0"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc