{"dist":{"shasum":"6a9007e5c268f670e45f170bb4c3be720a8bdca4","tarball":"https://registry.npmjs.org/@builder/swc/-/swc-0.1.4-beta.1.tgz","fileCount":7,"integrity":"sha512-OJMav5rtSUneWskv4m2537tpjcwnlaI7banupUU5qv2PsYK3NIITAXRFf0CdmolaDySjG69G0ZPPcwrkP8QanQ==","signatures":[{"sig":"MEUCIG0I+Jt/bVh2CihPbyeGJe/SFVdnkjvgE3iygeUNvY4qAiEA8QqidBxftDNzP+iEBMgsndDQCemj6tLhB7yQsZ19kjs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":31368,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiFuygACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmphLBAAog6Ec5MjedvtoxQ9p/IY8s9TvobCqwsTXze7qLm0f9ZKQ49e\r\n68R7lbh2TmJBtv2fJcsiK9S8AFNsaXhZtZIh1ofkoo26GmpgXUppljO6/WL+\r\nxN/H/Zt5+Lk3Cli9xPi5UIrP88lpm3tc+iir1RoMnAxEJNSfcKukKut006S6\r\nfDgpuSkGLtw1fKIktk9MhMyHipZhGsFbahWrxVZ1gLOnlmVxgaEKWTx/lHOG\r\nmMMVWuU3V6RrcLPTCER3amaX4pWJnSoeA+z/DwJyWX149zJlShBwCfuMexFz\r\nQFILaQ6nZY3N3PHrklEoxUhVizaCX1++vvz7LSk5zBVcdOW8KdNTcdaT4QhR\r\ne8b0qj6wzL1ByNaswF8D1smZOXhcI/Cy3z8nKqjq6ClbGBoW6FJ5VwJsj76n\r\nFZPeipA4cFSqZLGsaNLSKo/BlEFqye/syVNWrUSzeP6RFxV6IvCNY3Y2GgQ8\r\npRUb9e3Y+juyUfcVG6+E3RDcgptkX/n6LeYSdq+gk7WOgxWyhslfbLEL6NDd\r\nfDVV7lOLd1dPtCMmef03vMEICo8aiLYawi3LHKhHaN3UO8a3iZL/2i2vwQo9\r\nzk6QHwDQhNhzyFwRjBWc+CB3k9uqvNMV3cFSFQecSYW6g91vt9DqaDlYy/vd\r\nsYi3IuKsNUyZzCN6MQwJ/QcGJBYkI52A/Ww=\r\n=80HM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","name":"@builder/swc","napi":{"name":"builder-swc","triples":{"defaults":true,"additional":["aarch64-apple-darwin"]}},"husky":{"hooks":{"pre-push":"npm run lint","commit-msg":"commitlint -E HUSKY_GIT_PARAMS"}},"readme":"## @builder/swc\n\n> swc version is 0.81.1\n\n<img src=\"https://img.shields.io/npm/v/@builder/swc.svg\" alt=\"npm package\" />\n<img src=\"https://img.shields.io/npm/dm/@builder/swc.svg\" alt=\"npm downloads\" />\n\nCustom swc for [ice.js](https://github.com/alibaba/ice) and [rax-app](https://github.com/raxjs/rax-app).\n\n<i>Customization is achieved through the pass hook of swc.</i>\n\n### Platform Support\n\n- Windows x64\n- macOS x64\n- macOS aarch64\n- Linux aarch64 gnu\n\n### API\n\n#### transformSync(code: string, options)\n\n> Return { code: string, map?: string }\n\nSynchronous transform code. You can pass [@swc/core options](https://swc.rs/docs/configuration/compilation) directly.\n\n```js\nimport { transformSync } from '@builder/swc';\n\nconst { code, map } = transformSync('var a = 1;', {\n  jsc: {\n    parser: {\n      syntax: \"ecmascript\",\n    },\n    transform: {},\n  },\n});\n```\n\n**options.keepPlatform**\n\nTransform the variables which exported by `universal-env` to bool. The output code will remove other platform code by compressor.\n\n```js\nimport { transformSync } from '@builder/swc';\n\n// Input\nconst input = `\nimport { isWeb, isWeex } from 'universal-env';\n\nif (isWeb) {\n  console.log('This is web code');\n} else {\n  console.log('This is weex code');\n}\n`;\n\nconst { code, map } = transformSync(input, {\n  jsc: {\n    parser: {\n      syntax: \"ecmascript\",\n    },\n    transform: {},\n  },\n  keepPlatform: 'web',\n});\n\n/* The output code is:\nvar isWeb = true;\nvar isWeex = false;\n\nif (isWeb) {\n  console.log('This is web code');\n} else {\n  console.log('This is weex code');\n}\n*/\nconsole.log(code);\n```\n\n#### transform(code: string, options)\n\n> Return Promise<{ code: string, map?: string }>\n\nAsynchronous transform code. The options is the same as `transformSync`.\n\n```js\nimport { transformSync } from '@builder/swc';\n\nconst { code, map } = await transformSync(input, {\n  jsc: {\n    parser: {\n      syntax: \"ecmascript\",\n    },\n    transform: {},\n  },\n  keepPlatform: 'web',\n});\n```\n\n\n#### minify\n\n> Return Promise<{ code: string, map?: string }>\n\nIt is the same as [@swc/core](https://swc.rs/docs/configuration/minification).\n\nThis API is asynchronous and all of parsing, minification, and code generation will be done in background thread.\n\n```js\nimport { minify } from \"@builder/swc\";\n\nconst { code, map } = await minify(\n  \"import foo from '@src/app'; console.log(foo)\",\n  {\n    compress: false,\n    mangle: true,\n  }\n);\n\nexpect(code).toMatchInlineSnapshot(`\"import a from'@src/app';console.log(a);\"`);\n```\n\n#### minifySync\n\n> { code: string, map?: string }\n\nIt is the same as [@swc/core](https://swc.rs/docs/configuration/minification).\n\n```js\nimport { minifySync } from \"@builder/swc\";\n\nconst { code, map } = minifySync(\n  \"import foo from '@src/app'; console.log(foo)\",\n  {\n    compress: false,\n    mangle: true,\n  }\n);\n\nexpect(code).toMatchInlineSnapshot(`\"import a from'@src/app';console.log(a);\"`);\n```\n","engines":{"node":">= 12"},"gitHead":"583dd7579ce42616da6818b3575a7a4e19744ff7","license":"MIT","scripts":{"lint":"eslint --cache --ext .js,.jsx,.ts,.tsx ./","test":"jest --forceExit --ci","build":"npm run clean && npx tsc --build ./tsconfig.json","clean":"rimraf ./lib","setup":"rm -rf node_modules && yarn install && npm run build","watch":"npm run clean && npx tsc --build ./tsconfig.json -w","publish":"npm run copy:swc && ts-node ./scripts/publish-package.ts","version":"napi version -p ./npm -c ./package.json","copy:swc":"ts-node ./scripts/copySwcBinaries.ts","lint:fix":"npm run lint -- --fix","build:swc":"npm run clean:swc && napi build --platform --release --cargo-cwd ./ ./native","clean:swc":"rimraf ./native","test:watch":"jest --watch","publish:beta":"npm run copy:swc && PUBLISH_TYPE=beta ts-node ./scripts/publishPackageWithDistTag.ts"},"_npmUser":{"name":"luhengchang228","email":"luhengchang228@126.com"},"_npmVersion":"6.14.15","description":"> swc version is 0.81.1","directories":{},"maintainers":[{"name":"maoxiaoke","email":"thebigyellowbee@qq.com"},{"name":"solojiang","email":"feifeishen1996@gmail.com"},{"name":"chriscindy","email":"yxy0919@foxmail.com"},{"name":"rax-publisher","email":"rax-public@alibaba-inc.com"},{"name":"sobear","email":"sobear.me@gmail.com"},{"name":"clarkxia","email":"xiawenwu41@gmail.com"},{"name":"luhengchang228","email":"luhengchang228@126.com"}],"_nodeVersion":"14.17.6","dependencies":{"browserslist":"^4.19.3","@napi-rs/triples":"^1.0.3","@builder/swc-darwin-x64":"^0.1.0","@builder/swc-darwin-arm64":"^0.1.0","@builder/swc-linux-x64-gnu":"^0.1.0","@builder/swc-win32-x64-msvc":"^0.1.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.4.0","husky":"^4.1.0","eslint":"^7.0.0","semver":"^7.3.5","ts-jest":"^26.0.0","ts-node":"^8.6.1","fs-extra":"^10.0.0","typescript":"^4.0.0","@types/jest":"^25.2.1","@types/node":"^14.17.15","@napi-rs/cli":"^1.1.0","ice-npm-utils":"^3.0.1","@appworks/spec":"^1.0.0","@commitlint/cli":"^11.0.0"},"optionalDependencies":{"@builder/swc-darwin-x64":"^0.1.0","@builder/swc-darwin-arm64":"^0.1.0","@builder/swc-linux-x64-gnu":"^0.1.0","@builder/swc-win32-x64-msvc":"^0.1.0"},"_npmOperationalInternal":{"tmp":"tmp/swc_0.1.4-beta.1_1645669536046_0.050671057255798235","host":"s3://npm-registry-packages"},"_id":"@builder/swc@0.1.4-beta.1","version":"0.1.4-beta.1"}