refactor: remove buffer shim option from filer webpack plugin
This commit is contained in:
parent
708c84fc63
commit
1f02edf5b3
|
@ -23,7 +23,7 @@ module.exports = class FilerWebpackPlugin {
|
||||||
// Resolve fsProvider if required
|
// Resolve fsProvider if required
|
||||||
if (
|
if (
|
||||||
resolveData.request === 'fsProvider'
|
resolveData.request === 'fsProvider'
|
||||||
&& resolveData.context === this.options.shimsDir
|
&& resolveData.context === this.options.shimsDir
|
||||||
) {
|
) {
|
||||||
return this.resolveFsProvider(resolveData);
|
return this.resolveFsProvider(resolveData);
|
||||||
}
|
}
|
||||||
|
@ -39,9 +39,6 @@ module.exports = class FilerWebpackPlugin {
|
||||||
case 'path':
|
case 'path':
|
||||||
if (!this.options.shimPath) return;
|
if (!this.options.shimPath) return;
|
||||||
return this.applyPathShim(resolveData);
|
return this.applyPathShim(resolveData);
|
||||||
case 'buffer':
|
|
||||||
if (!this.options.shimBuffer) return;
|
|
||||||
return this.applyBufferShim(resolveData);
|
|
||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -81,8 +78,4 @@ module.exports = class FilerWebpackPlugin {
|
||||||
applyPathShim(resolveData) {
|
applyPathShim(resolveData) {
|
||||||
resolveData.request = path.join(this.options.shimsDir, 'path.js');
|
resolveData.request = path.join(this.options.shimsDir, 'path.js');
|
||||||
}
|
}
|
||||||
|
|
||||||
applyBufferShim(resolveData) {
|
|
||||||
resolveData.request = path.join(this.options.shimsDir, 'buffer.js');
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -22,7 +22,6 @@ module.exports = {
|
||||||
},
|
},
|
||||||
shimFs: { default: true },
|
shimFs: { default: true },
|
||||||
shimPath: { default: true},
|
shimPath: { default: true},
|
||||||
shimBuffer: { default: true},
|
|
||||||
fsProvider: { default: 'default'},
|
fsProvider: { default: 'default'},
|
||||||
fsProviderDir: {
|
fsProviderDir: {
|
||||||
process: function(value) {
|
process: function(value) {
|
||||||
|
|
|
@ -13,9 +13,6 @@ module.exports = {
|
||||||
shimPath: {
|
shimPath: {
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
},
|
},
|
||||||
shimBuffer: {
|
|
||||||
type: 'boolean',
|
|
||||||
},
|
|
||||||
fsProvider: {
|
fsProvider: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue