Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Removes webpack from the dependencies
  • Loading branch information
arcanis committed Mar 24, 2022
commit c2ec21b1bbb07546f91267ce16d3a06eb86e38d5
369 changes: 8 additions & 361 deletions .pnp.cjs

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
3 changes: 1 addition & 2 deletions packages/yarnpkg-builder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
"clipanion": "^3.2.0-rc.4",
"esbuild": "npm:esbuild-wasm@^0.11.20",
"semver": "^7.1.2",
"tslib": "^1.13.0",
"webpack": "^5.70.0"
"tslib": "^1.13.0"
},
"devDependencies": {
"@types/semver": "^7.1.0",
Expand Down
47 changes: 3 additions & 44 deletions packages/yarnpkg-builder/sources/commands/build/bundle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,6 @@ export default class BuildBundleCommand extends Command {
};

await xfs.mktempPromise(async p => {
xfs.detachTemp(p);

const esmDir = ppath.join(p, `esm` as Filename);
const cjsDir = ppath.join(p, `cjs` as Filename);

console.log(p);

let banner = `/* eslint-disable */\n//prettier-ignore\n`;
if (this.split)
banner += `import {createRequire} from 'module';\nconst require = createRequire(import.meta.url);`;
Expand All @@ -146,54 +139,20 @@ export default class BuildBundleCommand extends Command {
target: `node14`,
outExtension: {[`.js`]: '.mjs'},
...this.split ? {
outdir: npath.fromPortablePath(esmDir),
outdir: npath.fromPortablePath(p),
} : {
outfile: output,
}
});

if (this.split) {
/*
await new Promise((resolve, reject) => {
webpack({
mode: 'production',
target: 'node',
bail: true,
cache: false,
entry: {
cli: ppath.join(esmDir, `cli.js` as Filename),
},
output: {
path: npath.fromPortablePath(cjsDir),
},
optimization: {
splitChunks: {
chunks: 'async',
minSize: 1,
minRemainingSize: 0,
minChunks: 1,
maxAsyncRequests: 4000,
maxInitialRequests: 4000,
enforceSizeThreshold: 10000
},
},
}, (err, stats) => {
if (err) {
reject(err);
} else {
resolve(stats);
}
});
});
*/

const chunks = await xfs.readdirPromise(esmDir);
const chunks = await xfs.readdirPromise(p);

let payload = ``;

const packFiles = async () => {
return await Promise.all(chunks.map(async name => {
return [name, await xfs.readFilePromise(ppath.join(esmDir, name), `base64`)];
return [name, await xfs.readFilePromise(ppath.join(p, name), `base64`)];
}));
};

Expand Down
Loading