Background:
I have a lerna monorepo with yarn workspaces and two packages. I am using tsc as the TS compiler.
packages/module1/package.json:
"scripts": {
"watch": "tsc --watch",
"build": " tsc && tsc -m es6 --outDir ./dist/esm && webpack --config webpack.config.js",
}
packages/module2/package.json:
scripts: {
"watch": "tsc --watch",
"build": " tsc && tsc -m es6 --outDir ./dist/esm && webpack --config webpack.config.js",
}
root package.json:
"scripts": {
"build": "lerna run build",
"start:project": "lerna run start --scope=@project_name/project",
"start:project:watch": "concurrently \"yarn build && lerna run watch\" \"yarn start:project\"",
},
Expected Behavior:
yarn start:project:watch will run the build scripts and the watch scripts for each package
E.g. modifying any file in either package will rebuild the project and reload the page in the browser.
Current Behavior:
yarn start:project:watch will runs the build scripts and watch scripts for package1 only.
E.g. project is rebuilt when files in package1 are modified, but not rebuilt when package2 files are modified.
What might be going on and what could I be missing?