refactor: change fsprovider to fsProvider
This commit is contained in:
parent
9d03788c1c
commit
9c669564b2
|
@ -96,7 +96,7 @@ file system, configure webpack as shown below.
|
||||||
module.exports = {
|
module.exports = {
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
'fsprovider': 'filer/shims/providers/memory.js',
|
'fsProvider': 'filer/shims/providers/memory.js',
|
||||||
'fs': 'filer/shims/fs.js',
|
'fs': 'filer/shims/fs.js',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -109,11 +109,11 @@ The current options for file system providers are:
|
||||||
* IndexedDB - filer/shims/providers/default.js
|
* IndexedDB - filer/shims/providers/default.js
|
||||||
* Memory - filer/shims/providers/memory.js
|
* Memory - filer/shims/providers/memory.js
|
||||||
|
|
||||||
Though it's technically optional, it is recommended to include an alias for fsprovider in your
|
Though it's technically optional, it is recommended to include an alias for fsProvider in your
|
||||||
webpack config. This will prevent webpack from logging unnecessary warnings.
|
webpack config. This will prevent webpack from logging unnecessary warnings.
|
||||||
|
|
||||||
If you wish to use your own file system provider with the node.js [fs module](http://nodejs.org/api/fs.html)
|
If you wish to use your own file system provider with the node.js [fs module](http://nodejs.org/api/fs.html)
|
||||||
shim, it will be necessary to include an alias for fsprovider which points to your providers implementation.
|
shim, it will be necessary to include an alias for fsProvider which points to your providers implementation.
|
||||||
This can be done as follows:
|
This can be done as follows:
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
|
@ -123,7 +123,7 @@ const path = require('path');
|
||||||
module.exports = {
|
module.exports = {
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
'fsprovider': path.resolve(__dirname, 'example/dir/provider.js'),
|
'fsProvider': path.resolve(__dirname, 'example/dir/provider.js'),
|
||||||
'fs': 'filer/shims/fs.js',
|
'fs': 'filer/shims/fs.js',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@ const { FileSystem } = require('../src/index');
|
||||||
|
|
||||||
let Provider;
|
let Provider;
|
||||||
try {
|
try {
|
||||||
Provider = require('fsprovider');
|
Provider = require('fsProvider');
|
||||||
}
|
}
|
||||||
catch {
|
catch {
|
||||||
Provider = require('./providers/default');
|
Provider = require('./providers/default');
|
||||||
|
|
Loading…
Reference in New Issue