MCPcopy
hub / github.com/tailwindlabs/tailwindcss / pack

Function pack

scripts/pack-packages.mjs:36–53  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

34Promise.all(
35 [...workspaces.entries()].map(async ([name, { dir, hasBundledDependencies }]) => {
36 function pack() {
37 return new Promise((resolve) => {
38 // `bundledDependencies` can only be packed with the hoisted node linker
39 // since pnpm v10. We opt into it for those packages only, instead of
40 // changing the node linker for the entire workspace.
41 exec(
42 `pnpm pack --pack-gzip-level=0 --pack-destination="${path.join(root, 'dist').replace(/\\/g, '\\\\')}"${hasBundledDependencies ? ' --config.node-linker=hoisted' : ''}`,
43 { cwd: dir },
44 (err, stdout, stderr) => {
45 if (err) {
46 console.error(err, stdout, stderr)
47 }
48
49 resolve(lastLine(stdout.trim()))
50 },
51 )
52 })
53 }
54
55 let filename = await pack()
56 // Remove version suffix

Callers 1

pack-packages.mjsFile · 0.85

Calls 4

execFunction · 0.85
lastLineFunction · 0.85
errorMethod · 0.80
resolveFunction · 0.50

Tested by

no test coverage detected