filer/src/webpack-plugin/processors.js

35 lines
850 B
JavaScript
Raw Normal View History

var path = require('path');
2021-04-04 00:22:28 +00:00
const ROOT_DIR_TAG = '<rootDir>';
const CWD = process.cwd();
module.exports = {
filerDir: {
process: function(value) {
if (!value) {
return path.join(CWD, 'node_modules', 'filer');
}
return path.resolve(value.replace(ROOT_DIR_TAG, CWD));
2021-04-04 00:22:28 +00:00
},
},
shimsDir: {
process: function(value) {
if (!value) {
return path.join(CWD, 'node_modules', 'filer', 'shims');
}
return path.resolve(value.replace(ROOT_DIR_TAG, CWD));
}
},
fsProviderDir: {
process: function(value) {
if (!value) {
return path.join(CWD, 'node_modules', 'filer', 'shims', 'providers');
}
return path.resolve(value.replace(ROOT_DIR_TAG, CWD));
2021-04-04 00:22:28 +00:00
},
},
shimFs: { default: true },
shimPath: { default: true},
fsProvider: { default: 'default'},
2021-04-04 00:22:28 +00:00
};