refactor: polyfill punycode (#1244)

pull/1199/head
Divyansh Singh 2 years ago committed by GitHub
parent 034717eea3
commit 5c3e6d1088
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -151,6 +151,7 @@
"polka": "^0.5.2",
"prettier": "^2.7.1",
"prompts": "^2.4.2",
"punycode": "^2.1.1",
"rimraf": "^3.0.2",
"rollup": "^2.78.0",
"rollup-plugin-dts": "^4.2.2",

@ -69,6 +69,7 @@ importers:
polka: ^0.5.2
prettier: ^2.7.1
prompts: ^2.4.2
punycode: ^2.1.1
rimraf: ^3.0.2
rollup: ^2.78.0
rollup-plugin-dts: ^4.2.2
@ -153,6 +154,7 @@ importers:
polka: 0.5.2
prettier: 2.7.1
prompts: 2.4.2
punycode: 2.1.1
rimraf: 3.0.2
rollup: 2.78.0
rollup-plugin-dts: 4.2.2_nm5mlcuxlwr6samvke7b2fz27i
@ -3246,6 +3248,11 @@ packages:
sisteransi: 1.0.5
dev: true
/punycode/2.1.1:
resolution: {integrity: sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==}
engines: {node: '>=6'}
dev: true
/q/1.5.1:
resolution: {integrity: sha512-kV/CThkXo6xyFEZUugw/+pIOywXcDbFYgSct5cT3gqlbkBE1SJdwy6UQoZvodiWF/ckQLZyDE/Bu1M6gVu5lVw==}
engines: {node: '>=0.6.0', teleport: '>=0.2.0'}

@ -1,4 +1,5 @@
import { promises as fs } from 'fs'
import { builtinModules } from 'module'
import { resolve } from 'path'
import { fileURLToPath } from 'url'
import { RollupOptions, defineConfig } from 'rollup'
@ -17,7 +18,12 @@ const PROD = !DEV
const ROOT = fileURLToPath(import.meta.url)
const r = (p: string) => resolve(ROOT, '..', p)
const external = [...Object.keys(pkg.dependencies)]
const external = [
...Object.keys(pkg.dependencies),
...builtinModules.flatMap((m) =>
m.includes('punycode') ? [] : [m, `node:${m}`]
)
]
const plugins = [
alias({
@ -32,7 +38,7 @@ const plugins = [
preventAssignment: true
}),
commonjs(),
nodeResolve({ preferBuiltins: true }),
nodeResolve({ preferBuiltins: false }),
esbuild({ target: 'node14' }),
json()
]

Loading…
Cancel
Save