typescript - การกำหนดค่า aurelia.json เพื่อโหลดแพ็กเกจ npm ของ googleapis
ฉันกำลังพยายามกำหนดค่า aurelia.json ในแอปพลิเคชัน Aurelia TypeScript เพื่อรวมแพ็กเกจ googleapis npm ที่ถูกโหลดโดย loader แต่ระหว่างการสร้าง/การรวมไฟล์ด้วย aurelia-cli ฉันมักจะได้รับข้อผิดพลาด
นั่นคือวิธีที่ฉันได้เพิ่มมันเข้าไปใน aurelia.json
{
"name": "googleapis",
"main": "build/src/index",
"path": "../node_modules/googleapis",
"resources": []
},
{
"name": "googleapis-common",
"main": "build/src/index",
"path": "../node_modules/googleapis-common",
"resources": []
},
{
"name": "google-auth-library",
"main": "build/src/index",
"path": "../node_modules/google-auth-library",
"resources": []
}
ข้อผิดพลาดที่ฉันได้รับคือ
------- File not found or not accessible ------
| Location: c:/projects/xyz/src/google-auth-library.js
| Requested by: c:/projects/xyz/src/resources/elements/html-elements/google-auth-button.js
| Is this a package? Make sure that it is configured in aurelia.json and that it is not a Node.js package
-----------------------------------------------
------- File not found or not accessible ------
| Location: c:/projects/xyz/src/googleapis-common.js
| Requested by: c:/projects/xyz/src/resources/elements/html-elements/google-auth-button.js
| Is this a package? Make sure that it is configured in aurelia.json and that it is not a Node.js package
-----------------------------------------------
------- File not found or not accessible ------
| Location: c:/projects/xyz/node_modules/googleapis/build/src/apis.js
| Requested by: c:/projects/xyz/src/resources/elements/html-elements/google-auth-button.js
| Is this a package? Make sure that it is configured in aurelia.json and that it is not a Node.js package
-----------------------------------------------
------- File not found or not accessible ------
| Location: c:/projects/xyz/src/google-auth-library.js
| Requested by: c:/projects/xyz/src/resources/elements/html-elements/google-auth-button.js
| Is this a package? Make sure that it is configured in aurelia.json and that it is not a Node.js package
-----------------------------------------------
------- File not found or not accessible ------
| Location: c:/projects/xyz/src/googleapis-common.js
| Requested by: c:/projects/xyz/src/resources/elements/html-elements/google-auth-button.js
| Is this a package? Make sure that it is configured in aurelia.json and that it is not a Node.js package
-----------------------------------------------
------- File not found or not accessible ------
| Location: c:/projects/xyz/node_modules/googleapis/build/src/apis.js
| Requested by: c:/projects/xyz/src/resources/elements/html-elements/google-auth-button.js
| Is this a package? Make sure that it is configured in aurelia.json and that it is not a Node.js package
ฉันต้องทำอะไรบ้างเพื่อให้มันใช้งานได้? วิธีที่ถูกต้องในการใช้ไลบรารีเหล่านี้กับ Aurelia คืออะไร?