UNPKG

uni-plugin-light

Version:

uni-app相关插件、loader及webpack基础配置

2 lines (1 loc) 652 B
"use strict";var t=require("loader-utils"),e="ALL";function n(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=(t.getOptions(this)||{}).platforms,c=void 0===r?n:r,s=process.env.UNI_PLATFORM||"";return c===e||c.indexOf(e)>-1||c.includes(s)}var r=["mp-weixin","mp-qq"];module.exports=function(t){if(!n.call(this,r))return t;var e=/:key="'(\w+)'\s*\+\s*(\w+)\s*"/g,c=/:key="(\w+)\s*\+\s*'(\w+)'\s*"/g;return e.test(t)?t.replace(e,(function(t,e,n){var r="`".concat(e,"-${").concat(n,"}`");return':key="'.concat(r,'"')})):c.test(t)?t.replace(c,(function(t,e,n){var r="`".concat(n,"-${").concat(e,"}`");return':key="'.concat(r,'"')})):t};