我有一个带有两个包的纱线工作区的 lerna monorepo。我使用 rollup 作为打包器。
包/模块1/package.json:
{
scripts: {
"watch": "rollup -c rollup.config.js --watch",
"build": "NODE_ENV=production && rollup -c rollup.config.js"
}
}
Run Code Online (Sandbox Code Playgroud)
包/module2/package.json:
{
scripts: {
"watch": "rollup -c rollup.config.js --watch",
"build": "NODE_ENV=production && rollup -c rollup.config.js"
}
}
Run Code Online (Sandbox Code Playgroud)
lerna run build将为build每个包运行脚本。lerna run watch将以watch监视模式运行每个包的脚本。lerna run build按预期工作。该build脚本对这两个包都可以正常运行。lerna run watch 只是挂在那里:lerna notice cli v3.13.1
lerna info Executing command in 2 packages: "yarn run watch"
[[just hangs …Run Code Online (Sandbox Code Playgroud)