You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
573 B
19 lines
573 B
6 months ago
|
"use strict";
|
||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||
|
exports.uniValidateFunctionPlugin = void 0;
|
||
|
function replaceModuleExports(code) {
|
||
|
return code.replace(/module\.exports\s*=/, 'export default ');
|
||
|
}
|
||
|
function uniValidateFunctionPlugin() {
|
||
|
return {
|
||
|
name: 'uni:cloud-vf',
|
||
|
enforce: 'pre',
|
||
|
transform(code, id) {
|
||
|
if (id.includes('validator/validateFunction')) {
|
||
|
return replaceModuleExports(code);
|
||
|
}
|
||
|
},
|
||
|
};
|
||
|
}
|
||
|
exports.uniValidateFunctionPlugin = uniValidateFunctionPlugin;
|