NervJS / taro-plugin-platform-weapp-qy

企业微信插件
21 stars 2 forks source link

引入后大部分taro 原有api无法使用 underfind #6

Closed panyu97py closed 3 years ago

panyu97py commented 3 years ago

image image image

{
    "name": "name",
    "version": "1.0.0",
    "private": true,
    "description": "",
    "templateInfo": {
        "name": "taro-ui",
        "typescript": false,
        "css": "sass"
    },
    "scripts": {
        "update": "taro update self",
        "build:weapp": "taro build --type weapp",
        "build:qyweapp": "taro build --type qywx",
        "build:swan": "taro build --type swan",
        "build:alipay": "taro build --type alipay",
        "build:tt": "taro build --type tt",
        "build:h5": "taro build --type h5",
        "build:rn": "taro build --type rn",
        "build:qq": "taro build --type qq",
        "build:jd": "taro build --type jd",
        "build:quickapp": "taro build --type quickapp",
    "dev:weapp": "npm run build:weapp -- --watch",
    "dev:qyweapp": "taro build --type qywx --watch",
        "dev:swan": "npm run build:swan -- --watch",
        "dev:alipay": "npm run build:alipay -- --watch",
        "dev:tt": "npm run build:tt -- --watch",
        "dev:h5": "npm run build:h5 -- --watch",
        "dev:rn": "npm run build:rn -- --watch",
        "dev:qq": "npm run build:qq -- --watch",
        "dev:jd": "npm run build:jd -- --watch",
        "dev:quickapp": "npm run build:quickapp -- --watch"
    },
    "browserslist": [
        "last 3 versions",
        "Android >= 4.1",
        "ios >= 8"
    ],
    "author": "",
    "dependencies": {
        "@babel/runtime": "^7.7.7",
        "@tarojs/cli": "3.2.8",
        "@tarojs/components": "3.2.8",
        "@tarojs/plugin-platform-weapp-qy": "^0.0.5",
        "@tarojs/react": "3.2.8",
        "@tarojs/runtime": "3.2.8",
        "@tarojs/taro": "3.2.8",
        "classnames": "^2.2.6",
        "dva-core": "^2.0.3",
        "dva-loading": "^3.0.21",
        "lodash": "4.17.15",
        "prettier": "^2.1.2",
        "react": "^16.10.0",
        "react-dom": "^16.10.0",
        "react-redux": "^7.2.1",
        "redux": "^4.0.5",
        "redux-logger": "^3.0.6",
        "taro-ui": "3.0.0-alpha.3"
    },
    "devDependencies": {
        "@babel/core": "^7.8.0",
        "@tarojs/mini-runner": "3.2.8",
        "@tarojs/webpack-runner": "3.2.8",
        "@types/react": "^16.0.0",
        "@types/webpack-env": "^1.13.6",
        "babel-preset-taro": "3.2.8",
        "eslint": "^6.8.0",
        "eslint-config-taro": "3.2.8",
        "eslint-plugin-import": "^2.12.0",
        "eslint-plugin-modules": "^1.1.1",
        "eslint-plugin-react": "^7.8.2",
        "eslint-plugin-react-hooks": "^1.6.1",
        "stylelint": "9.3.0"
    }
}
import path from 'path'

const config = {
  projectName: 'projectName',
  date: '2020-10-21',
  designWidth: 750,
  deviceRatio: {
    640: 2.34 / 2,
    750: 1,
    828: 1.81 / 2,
    375: 2,
  },
  alias: {
    '@pages': path.resolve(__dirname, '..', 'src/pages'),
    '@styles': path.resolve(__dirname, '..', 'src/styles'),
    '@utils': path.resolve(__dirname, '..', 'src/utils'),
    '@assets': path.resolve(__dirname, '..', 'src/assets'),
    '@lib': path.resolve(__dirname, '..', 'src/lib'),
    '@config': path.resolve(__dirname, '..', 'src/config'),
    '@components': path.resolve(__dirname, '..', 'src/components'),
    '@base': path.resolve(__dirname, '..', 'src/base'),
  },
  sourceRoot: 'src',
  outputRoot: 'dist',

  plugins: [
    '@tarojs/plugin-platform-weapp-qy'
  ],
  defineConstants: {},
  copy: {
    patterns: [],
    options: {},
  },
  framework: 'react',

  mini: {
    enableSourceMap: false,
    postcss: {
      pxtransform: {
        enable: true,
        config: {},
      },
      url: {
        enable: true,
        config: {
          limit: 1024, // 设定转换尺寸上限
        },
      },
      cssModules: {
        enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true
        config: {
          namingPattern: 'module', // 转换模式,取值为 global/module
          generateScopedName: '[name]__[local]___[hash:base64:5]',
        },
      },
    },
  },
  h5: {
    publicPath: '/',
    staticDirectory: 'static',
    postcss: {
      'postcss-px-scale': {
        'enable': true,
        'config': {
          'scale': 0.5, // 缩放为 1/2
          'units': 'rem',
          'includes': ['taro-ui'],
        },
      },
      autoprefixer: {
        enable: true,
        config: {},
      },
      cssModules: {
        enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true
        config: {
          namingPattern: 'module', // 转换模式,取值为 global/module
          generateScopedName: '[name]__[local]___[hash:base64:5]',
        },
      },
    },
  },
}

module.exports = function(merge) {
  if (process.env.NODE_ENV === 'development') {
    return merge({}, config, require('./dev'))
  }
  return merge({}, config, require('./prod'))
}
panyu97py commented 3 years ago

@Chen-jj

JasonStu commented 3 years ago

@Chen-jj 大佬出来解决一下

JasonStu commented 3 years ago

@panyu97py 解决方案:我用npm i 重新跑了一遍就可以了。 yarn add 有问题

panyu97py commented 3 years ago

@panyu97py 解决方案:我用npm i 重新跑了一遍就可以了。 yarn add 有问题

这么尴尬的吗? 我试试

DiveCore commented 3 years ago

@panyu97py 解决方案:我用npm i 重新跑了一遍就可以了。 yarn add 有问题

这么尴尬的吗? 我试试

请问解决了吗?我也遇到相同的问题了,但是重新 install 还是没有解决,

Chen-jj commented 3 years ago

使用 Taro 3.2 的话,把 @tarojs/plugin-platform-weapp-qy 插件升级到 0.0.6 后可以解决