-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
புதுச @constl/utils-test -இன் aegir அமைப்புகளைப் பயன்படுத்து
- Loading branch information
1 parent
278e1b6
commit 0fa9f60
Showing
3 changed files
with
697 additions
and
688 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +1,3 @@ | ||
import path, { dirname } from "path"; | ||
import { fileURLToPath } from "url"; | ||
import { createRequire } from "module"; | ||
import { config } from "@constl/utils-tests"; | ||
|
||
const require = createRequire(import.meta.url); | ||
|
||
const __dirname = dirname(fileURLToPath(import.meta.url)); | ||
|
||
// https://github.com/node-webrtc/node-webrtc/issues/636#issuecomment-774171409 | ||
process.on("beforeExit", (code) => process.exit(code)); | ||
|
||
// https://github.com/ipfs/aegir/blob/master/md/migration-to-v31.md | ||
const esbuild = { | ||
// this will inject all the named exports from 'node-globals.js' as globals | ||
inject: [path.join(__dirname, "./scripts/node-globals.js")], | ||
external: [ | ||
"fs", | ||
"path", | ||
"os", | ||
"chokidar", | ||
"url", | ||
"zlib", | ||
"rimraf", | ||
"electron", | ||
"env-paths", | ||
"@libp2p/tcp", | ||
"@libp2p/mdns", | ||
], | ||
plugins: [ | ||
{ | ||
name: "node built ins", // this will make the bundler resolve node builtins to the respective browser polyfill | ||
setup(build) { | ||
build.onResolve({ filter: /^stream$/ }, () => { | ||
return { path: require.resolve("stream-browserify") }; | ||
}); | ||
build.onResolve({ filter: /^os$/ }, () => { | ||
return { path: require.resolve("os-browserify") }; | ||
}); | ||
build.onResolve({ filter: /^node\:process$/ }, () => { | ||
return { path: require.resolve("process/browser") }; | ||
}); | ||
build.onResolve({ filter: /^crypto$/ }, () => { | ||
return { path: require.resolve("crypto-browserify") }; | ||
}); | ||
build.onResolve({ filter: /^fs/ }, () => { | ||
return { path: require.resolve("browserify-fs") }; | ||
}); | ||
}, | ||
}, | ||
], | ||
}; | ||
|
||
/** @type {import('aegir').PartialOptions} */ | ||
const options = { | ||
test: { | ||
browser: { | ||
config: { | ||
buildConfig: esbuild, | ||
}, | ||
}, | ||
}, | ||
build: { | ||
config: esbuild, | ||
}, | ||
}; | ||
|
||
export default options; | ||
export default config.générerConfigÆgir(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.