A normal one-time build works fine. However, when using rollup -w
, rpt2 seems to have trouble finding source files if I edit one of the deeper module dependencies in one of the other packages.
This is with a Lerna monorepo setting up symlinks to the in-repo dependencies.
Test repo: https://github.com/jrburke/jr-monorepo-rpt2
I do not want to use preserveSymlinks
because in my real project, it results in duplicates of modules in the final built project, since multiple packages in the repo share common dependencies. I have tried a version using preserveSymlinks
, and so as a last resort I could configure a dev setup that uses preserveSymlinks
, but standalone/first time builds work without it, and I would like to keep the watch setup the same as the normal builds.
Details to reproduce in the above example repo.
import commonjs from '@rollup/plugin-commonjs';
import resolve from '@rollup/plugin-node-resolve';
import typescript from 'rollup-plugin-typescript2';
export default {
input: 'src/index.ts',
output: {
file: 'dist/jr-player.js',
format: 'iife',
name: 'jrPlayer',
exports: 'named'
},
watch: {
include: ['src/**', '../jr-lib/src/**', '../jr-auth/src/**']
},
plugins: [
typescript({
include: ['src/**/*.ts+(|x)', '../jr-lib/**/*.ts+(|x)', '../jr-auth/**/*.ts+(|x)'],
verbosity: 3
}),
resolve(),
commonjs()
]
};
Top level tsconfig.json:
{
"compilerOptions": {
"moduleResolution": "node",
"module": "es2015",
"lib": [
"es2015",
"es2016",
"es2017",
"dom"
],
"strict": true,
"sourceMap": true,
"declaration": true,
"allowSyntheticDefaultImports": true,
"downlevelIteration": true,
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"noImplicitAny": false,
"esModuleInterop": true,
"removeComments": true,
"resolveJsonModule": true,
"skipLibCheck": true
}
}
packages/jr-player/tsconfig.json
:
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"target": "es5",
"declarationDir": "lib",
"outDir": "lib"
},
"include": ["."]
}
I don't think it is relevant, but it is in the test repo.
Attached, but also in test repo at verbose-error.txt
:
Might be related to #188
Another workaround is to disable typechecking with check: false
, of course that removes majority of functionality...
I have the issue combining rollup-plugin-typescript2
and rollup-plugin-postcss
. When I import a _css_ file (e.g. import * as style from ./mystyle.css
) and I enable _watch_ flag, it gives me the same error.
I'll try debug a little bit more, but indeed check: false
fix the issue.