Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

需要 monorepo 支持 #3116

Closed
grepug opened this issue May 21, 2019 · 4 comments
Closed

需要 monorepo 支持 #3116

grepug opened this issue May 21, 2019 · 4 comments
Assignees

Comments

@grepug
Copy link

grepug commented May 21, 2019

问题描述
[问题描述:站在其它人的角度尽可能清晰地、简洁地把问题描述清楚]

使用 lerna建立monorepo 时,将依赖提升到根目录,编译小程序时引用 @tarojs/taro-weapp/index.js 路径出错,表现为:

  • 未拷贝 npm 代码到dist/weapp目录下
  • 引用 @tarojs/taro-weapp 包,路径错误
App(require('../../../../node_modules/@tarojs/taro-weapp/index.js').default.createApp(_App));
_index2.default.initPxTransform({
  "designWidth": 750,
  "deviceRatio": {
    "640": 1.17,
    "750": 1,
    "828": 0.905
  }
});

系统信息

👽 Taro v1.3.0-beta.3


  Taro CLI 1.3.0-beta.3 environment info:
    System:
      OS: macOS 10.14.5
      Shell: 5.3 - /bin/zsh
    Binaries:
      Node: 10.11.0 - /usr/local/bin/node
      Yarn: 1.12.3 - ~/npm/bin/yarn
      npm: 6.4.1 - /usr/local/bin/npm
    npmPackages:
      @tarojs/cli: latest => 1.3.0-beta.3 
      @tarojs/components: 1.3.0-beta.3 => 1.3.0-beta.3 
      @tarojs/plugin-babel: 1.3.0-beta.3 => 1.3.0-beta.3 
      @tarojs/plugin-csso: 1.3.0-beta.3 => 1.3.0-beta.3 
      @tarojs/plugin-less: 1.3.0-beta.3 => 1.3.0-beta.3 
      @tarojs/plugin-uglifyjs: 1.3.0-beta.3 => 1.3.0-beta.3 
      @tarojs/router: 1.3.0-beta.3 => 1.3.0-beta.3 
      @tarojs/taro: 1.3.0-beta.3 => 1.3.0-beta.3 
      @tarojs/taro-alipay: 1.3.0-beta.3 => 1.3.0-beta.3 
      @tarojs/taro-h5: 1.3.0-beta.3 => 1.3.0-beta.3 
      @tarojs/taro-swan: 1.3.0-beta.3 => 1.3.0-beta.3 
      @tarojs/taro-weapp: 1.3.0-beta.3 => 1.3.0-beta.3 
      @tarojs/webpack-runner: 1.3.0-beta.3 => 1.3.0-beta.3 
      eslint-config-taro: 1.3.0-beta.3 => 1.3.0-beta.3 
      eslint-plugin-taro: 1.3.0-beta.3 => 1.3.0-beta.3 
      nervjs: ^1.4.0-beta.3 => 1.4.0-beta.4 

@taro-bot
Copy link

taro-bot bot commented May 21, 2019

欢迎提交 Issue~

如果你提交的是 bug 报告,请务必遵循 Issue 模板的规范,尽量用简洁的语言描述你的问题,最好能提供一个稳定简单的复现。🙏🙏🙏

如果你的信息提供过于模糊或不足,或者已经其他 issue 已经存在相关内容,你的 issue 有可能会被关闭。

Good luck and happy coding~

@cncolder
Copy link
Contributor

cncolder commented May 22, 2019

这个问题由来已久. 我目前使用的是 yarn workspaces, 同时 taro 项目单独安装依赖:

lerna.json

    "npmClient": "yarn",
    "useWorkspaces": true,

.yarnrc

workspaces-experimental true

package.json

    "workspaces": {
        "packages": [
            "packages/*"
        ],
        "nohoist": [
            "@myorg/mp/**",
			"your-package-name/**"
        ]
    },

@taro-bot
Copy link

taro-bot bot commented Nov 18, 2019

CC @luckyadam

@shenghanqin
Copy link
Collaborator

#3153 可能相应的pr并没有合并?

@Chen-jj Chen-jj closed this as completed Jul 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants