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

ant-app-builder

Package Overview
Dependencies
Maintainers
1
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ant-app-builder - npm Package Compare versions

Comparing version 1.5.2 to 1.5.3

42

lib/index.js

@@ -10,3 +10,3 @@

const { FS } = require("./common")
const buildFileLimit = 1024 * 1024 * 5
const buildFileLimit = 1024 * 1024 * 5 // = 5 MB
const ant_require_rx = /defiant\.require\(['"](.+?)['"]\)/g

@@ -35,3 +35,3 @@

let destDir = FS.path.dirname(dest)
let _uglify = task._attributes.action === "uglify" || uglify
let _uglify = task._attributes.action === "minify" || uglify

@@ -311,39 +311,2 @@ let ant_require = async function(baseDir, reqStr, exclude) {

// ** Monifies JS modules
const Bundle = async (filePath) => {
let parts = FS.path.parse(filePath)
let destPath = FS.path.join(parts.dir, parts.name +".min"+ parts.ext)
/**/
// rollup.js
let bundle = await rollup.rollup({ input: filePath, treeshake: false })
let { output } = await bundle.generate({ format: "esm" })
console.time("Requires")
// custom require-parser
let code = output[0].code
let requires = code.match(ant_require_rx) || []
// loop all requires
await Promise.all(requires.map(async item => requireFile(dirPath, item)))
// fix paths to app public folder
code = code.replace(/\/\*[\s\S]*?\*\/|([^\\:]|^)\/\/.*$/gm, '$1');
code = code.replace(/\t/g, "")
code = code.replace(/\n\n/gm, "")
console.timeEnd("Requires")
console.time("Terser")
// terser.js
let options = { compress: false, module: false, mangle: true }
let parsed = terser.minify(code, options)
console.timeEnd("Terser")
await FS.writeFile(destPath, parsed.code)
parts = FS.path.parse(destPath)
return parts.base
}
// ** Builds def-ant application

@@ -446,3 +409,2 @@ const Build = (srcDir, destDir, uglify) => {

Build,
Bundle,
}

2

package.json
{
"name": "ant-app-builder",
"version": "1.5.2",
"version": "1.5.3",
"description": "",

@@ -5,0 +5,0 @@ "main": "./lib",

@@ -10,5 +10,2 @@

let runIt = async() => {
// let src = path.join(srcDir, "/src/js/bundle.js")
// await Bundle(src)
let b = await Build(srcDir, destDir, uglify)

@@ -15,0 +12,0 @@ //console.log(b)

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