夥計。epubJS離子3集成
我想在我的Ionic 3測試應用程序中打開ePub文件沒有成功。
我通過npm安裝了epubjs。作爲的package.json:在閱讀頁面
{
"name": "app_name",
"author": "Author",
"homepage": "http://example.com/",
"private": true,
"scripts": {
"clean": "ionic-app-scripts clean",
"build": "ionic-app-scripts build",
"ionic:build": "ionic-app-scripts build",
"ionic:serve": "ionic-app-scripts serve"
},
"dependencies": {
"@angular/animations": "4.1.3",
"@angular/common": "4.1.3",
"@angular/compiler": "4.1.3",
"@angular/compiler-cli": "4.1.3",
"@angular/core": "4.1.3",
"@angular/forms": "4.1.3",
"@angular/http": "4.1.3",
"@angular/platform-browser": "4.1.3",
"@angular/platform-browser-dynamic": "4.1.3",
"@angular/platform-server": "4.1.3",
"@ionic-native/core": "3.12.1",
"@ionic-native/device": "^3.12.1",
"@ionic-native/network": "^3.12.1",
"@ionic-native/splash-screen": "3.12.1",
"@ionic-native/status-bar": "3.12.1",
"@ionic-native/transfer": "^3.12.1",
"@ionic/storage": "2.0.1",
"epubjs": "^0.2.20",
"ionic-angular": "3.4.0",
"ionicons": "3.0.0",
"ng2-pdf-viewer": "^1.1.0",
"rxjs": "5.4.0",
"sw-toolbox": "3.6.0",
"zone.js": "0.8.12"
},
"devDependencies": {
"@ionic/app-scripts": "1.3.7",
"@ionic/cli-plugin-ionic-angular": "1.3.1",
"typescript": "2.3.4"
},
"cordovaPlugins": [
"cordova-plugin-whitelist",
"cordova-plugin-console",
"cordova-plugin-statusbar",
"cordova-plugin-device",
"cordova-plugin-splashscreen",
"ionic-plugin-keyboard"
],
"cordovaPlatforms": [],
"description": "readerApp"
}
導入epubjs(import {epubjs} from 'epubjs';
)(頁/讀卡器/ reader.ts)似乎確定。但當我嘗試創建ePub書籍(let book = epubjs.ePub(url)
)時,我在應用程序運行時收到以下錯誤消息:
未捕獲錯誤:模塊解析失敗:/ home // dev_mobile // node_modules/@ ionic/app-scripts/dist/webpack/transpile-loader.js!/home//dev_mobile//node_modules/epubjs/server.js意外字符'#'(1:0) 您可能需要一個合適的加載程序來處理此文件類型。 | #!/ usr/bin/env node | var connect = require('connect'), |顏色=要求('顏色'),。 。 。
過去3天內搜索了沒有任何線索。任何人也有這個?
我的猜測是epubjs集成並不是很成熟,但我對如何修復它知之甚少= |