提交 6f687349 编写于 作者: fxy060608's avatar fxy060608

fix(app-plus): wxcomponents (https://ask.dcloud.net.cn/question/77358)

上级 31d00592
...@@ -79,7 +79,7 @@ const PLATFORMS = { ...@@ -79,7 +79,7 @@ const PLATFORMS = {
exts: false, exts: false,
vue: '@dcloudio/vue-cli-plugin-uni/packages/h5-vue', vue: '@dcloudio/vue-cli-plugin-uni/packages/h5-vue',
compiler: false, compiler: false,
megalo: false, megalo: false,
filterTag: 'wxs', filterTag: 'wxs',
subPackages: false, subPackages: false,
cssVars: { cssVars: {
...@@ -124,11 +124,15 @@ const PLATFORMS = { ...@@ -124,11 +124,15 @@ const PLATFORMS = {
assetsDir assetsDir
}) { }) {
const files = ['hybrid/html'] const files = ['hybrid/html']
let wxcomponents = []
if (!process.env.UNI_USING_NATIVE) { if (!process.env.UNI_USING_NATIVE) {
files.push('wxcomponents') wxcomponents = getCopyOptions(['wxcomponents'], {
to: path.resolve(process.env.UNI_OUTPUT_TMP_DIR, 'wxcomponents')
})
} }
return [ return [
...getStaticCopyOptions(assetsDir), ...getStaticCopyOptions(assetsDir),
...wxcomponents,
...getCopyOptions(files) ...getCopyOptions(files)
] ]
} }
...@@ -399,19 +403,19 @@ function devtoolModuleFilenameTemplate (info) { ...@@ -399,19 +403,19 @@ function devtoolModuleFilenameTemplate (info) {
) { ) {
return `uni-app:///${filePath}` return `uni-app:///${filePath}`
} }
} }
const NODE_MODULES_REGEX = /(\.\.\/)?node_modules/g const NODE_MODULES_REGEX = /(\.\.\/)?node_modules/g
function normalizeNodeModules (str) { function normalizeNodeModules (str) {
str = str.replace(NODE_MODULES_REGEX, 'node-modules') str = str.replace(NODE_MODULES_REGEX, 'node-modules')
if (process.env.UNI_PLATFORM === 'mp-alipay') { if (process.env.UNI_PLATFORM === 'mp-alipay') {
str = str.replace('node-modules/@', 'node-modules/npm-scope-') str = str.replace('node-modules/@', 'node-modules/npm-scope-')
} }
return str return str
} }
module.exports = { module.exports = {
normalizeNodeModules, normalizeNodeModules,
isInHBuilderX, isInHBuilderX,
isInHBuilderXAlpha, isInHBuilderXAlpha,
......
{ {
"name": "@dcloudio/uni-cli-shared", "name": "@dcloudio/uni-cli-shared",
"version": "0.2.990", "version": "0.2.991",
"description": "uni-cli-shared", "description": "uni-cli-shared",
"main": "lib/index.js", "main": "lib/index.js",
"files": [ "files": [
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册