我無法獲得cordova-promise-fs在我的科爾多瓦應用程序中工作。CordovaPromiseFS未定義
我有:index.html,其中包含由browserify創建的一個js文件。這個js文件包含cordovapromisefs.js,promiscuous.js和我自己的代碼的內容,那就是:
require('../node_modules/cordova-promise-fs/dist/CordovaPromiseFS.js');
var fs = CordovaPromiseFS({
persistent: true, // or false
storageSize: 20 * 1024 * 1024, // storage size in bytes, default 20MB
concurrency: 3, // how many concurrent uploads/downloads?
Promise: require('../node_modules/promiscuous/promiscuous.js') // Your favorite Promise/A+ library!
});
(function() {
"use strict";
document.addEventListener('deviceready', onDeviceReady.bind(this), false);
function onDeviceReady() {
console.log(fs);
};
})();
我想這應該把工作做好,但現在,我將「未捕獲的ReferenceError:CordovaPromiseFS沒有定義「
願意指出正確的方向。
就是這樣,謝謝!顯然,我並沒有完全瞭解到browserify已經在做什麼以及需要做什麼。 – Wheelie