2019-01-03 02:21:25 +00:00
|
|
|
let fs = null;
|
|
|
|
let Filer = null;
|
|
|
|
|
|
|
|
module.exports = Filer = {
|
2014-05-23 18:14:06 +00:00
|
|
|
FileSystem: require('./filesystem/interface.js'),
|
2018-12-02 00:57:09 +00:00
|
|
|
Buffer: Buffer,
|
2019-01-03 02:21:25 +00:00
|
|
|
// We previously called this Path, but node calls it path. Do both
|
2014-05-23 18:14:06 +00:00
|
|
|
Path: require('./path.js'),
|
2019-01-03 02:21:25 +00:00
|
|
|
path: require('./path.js'),
|
2014-10-17 16:28:03 +00:00
|
|
|
Errors: require('./errors.js'),
|
2021-04-04 00:22:50 +00:00
|
|
|
Shell: require('./shell/shell.js'),
|
2021-11-15 16:05:39 +00:00
|
|
|
/**
|
|
|
|
* @deprecated Importing filer from your webpack config is not recommended.
|
|
|
|
*
|
|
|
|
* The filer `FilerWebpackPlugin` class is exposed directly.
|
|
|
|
*
|
|
|
|
* ```
|
|
|
|
* const { FilerWebpackPlugin } = require('filer/webpack');
|
|
|
|
* ```
|
|
|
|
*/
|
2021-04-18 13:43:39 +00:00
|
|
|
FilerWebpackPlugin: require('./webpack-plugin'),
|
2014-05-23 18:14:06 +00:00
|
|
|
};
|
2019-01-03 02:21:25 +00:00
|
|
|
|
|
|
|
// Add a getter for the `fs` instance, which returns
|
|
|
|
// a Filer FileSystem instance, using the default provider/flags.
|
|
|
|
Object.defineProperty(Filer, 'fs', {
|
|
|
|
enumerable: true,
|
|
|
|
get() {
|
|
|
|
if(!fs) {
|
|
|
|
fs = new Filer.FileSystem();
|
|
|
|
}
|
|
|
|
return fs;
|
|
|
|
}
|
|
|
|
});
|