mirror of
https://github.com/dillonkearns/elm-pages-v3-beta.git
synced 2024-11-30 23:06:10 +03:00
Remove xhr2 dependency.
This commit is contained in:
parent
d22a663a90
commit
b38815170f
@ -30,7 +30,9 @@ async function ensureRequiredDirs() {
|
|||||||
|
|
||||||
async function run(options) {
|
async function run(options) {
|
||||||
await ensureRequiredDirs();
|
await ensureRequiredDirs();
|
||||||
XMLHttpRequest = require("xhr2");
|
// since init/update are never called in pre-renders, and DataSource.Http is called using undici
|
||||||
|
// we can provide a fake HTTP instead of xhr2 (which is otherwise needed for Elm HTTP requests from Node)
|
||||||
|
XMLHttpRequest = {};
|
||||||
|
|
||||||
const generateCode = codegen.generate();
|
const generateCode = codegen.generate();
|
||||||
|
|
||||||
|
@ -22,7 +22,9 @@ module.exports =
|
|||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
async function run(elmModule, path, request, addDataSourceWatcher) {
|
async function run(elmModule, path, request, addDataSourceWatcher) {
|
||||||
XMLHttpRequest = require("xhr2");
|
// since init/update are never called in pre-renders, and DataSource.Http is called using undici
|
||||||
|
// we can provide a fake HTTP instead of xhr2 (which is otherwise needed for Elm HTTP requests from Node)
|
||||||
|
XMLHttpRequest = {};
|
||||||
const result = await runElmApp(
|
const result = await runElmApp(
|
||||||
elmModule,
|
elmModule,
|
||||||
path,
|
path,
|
||||||
|
16
package-lock.json
generated
16
package-lock.json
generated
@ -24,8 +24,7 @@
|
|||||||
"object-hash": "^2.2.0",
|
"object-hash": "^2.2.0",
|
||||||
"serve-static": "^1.14.1",
|
"serve-static": "^1.14.1",
|
||||||
"terser": "^5.7.0",
|
"terser": "^5.7.0",
|
||||||
"undici": "^4.1.0",
|
"undici": "^4.1.0"
|
||||||
"xhr2": "^0.2.1"
|
|
||||||
},
|
},
|
||||||
"bin": {
|
"bin": {
|
||||||
"elm-pages": "generator/src/cli.js"
|
"elm-pages": "generator/src/cli.js"
|
||||||
@ -5988,14 +5987,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/xhr2": {
|
|
||||||
"version": "0.2.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/xhr2/-/xhr2-0.2.1.tgz",
|
|
||||||
"integrity": "sha512-sID0rrVCqkVNUn8t6xuv9+6FViXjUVXq8H5rWOH2rz9fDNQEd4g0EA2XlcEdJXRz5BMEn4O1pJFdT+z4YHhoWw==",
|
|
||||||
"engines": {
|
|
||||||
"node": ">= 6"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/xmlbuilder": {
|
"node_modules/xmlbuilder": {
|
||||||
"version": "13.0.2",
|
"version": "13.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-13.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-13.0.2.tgz",
|
||||||
@ -10831,11 +10822,6 @@
|
|||||||
"integrity": "sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A==",
|
"integrity": "sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A==",
|
||||||
"requires": {}
|
"requires": {}
|
||||||
},
|
},
|
||||||
"xhr2": {
|
|
||||||
"version": "0.2.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/xhr2/-/xhr2-0.2.1.tgz",
|
|
||||||
"integrity": "sha512-sID0rrVCqkVNUn8t6xuv9+6FViXjUVXq8H5rWOH2rz9fDNQEd4g0EA2XlcEdJXRz5BMEn4O1pJFdT+z4YHhoWw=="
|
|
||||||
},
|
|
||||||
"xmlbuilder": {
|
"xmlbuilder": {
|
||||||
"version": "13.0.2",
|
"version": "13.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-13.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-13.0.2.tgz",
|
||||||
|
@ -38,8 +38,7 @@
|
|||||||
"object-hash": "^2.2.0",
|
"object-hash": "^2.2.0",
|
||||||
"serve-static": "^1.14.1",
|
"serve-static": "^1.14.1",
|
||||||
"terser": "^5.7.0",
|
"terser": "^5.7.0",
|
||||||
"undici": "^4.1.0",
|
"undici": "^4.1.0"
|
||||||
"xhr2": "^0.2.1"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/cross-spawn": "^6.0.2",
|
"@types/cross-spawn": "^6.0.2",
|
||||||
|
Loading…
Reference in New Issue
Block a user