I recently added an Angular library to my Angular project. I compile and symlink the lib into my node_modules folder for the main project.
Unfortunately, the compiled code is not triggering a rebuild of the main project.
I've tried many thing:
Watch options:
watchOptions: { ignored: [ // Ignore all node_modules, except my_module /node_modules([\\]+|\/)+(?!my_module)/, /my_module([\\]+|\/)node_modules/, ], },"preserveSymlinks": truein angular.jsonTried filewatcher-webpack-plugin:
new filewatcherPlugin({ watchFileRegex: [ require.resolve('my_module') ] }),Result: When lib compiled, changes are detected and webpack crashes with "ConcurrentCompilationError: You ran Webpack twice."
Tried webpack-watch-files-plugin
new WatchExternalFilesPlugin({ files: [ './dist/my_module/bundles/my_module.umd.js' ], verbose: true })Result: Correctly logs "Additional files watched: [file path]", but does not trigger compilation when the symlinked library is compiled.
Tried extra-watch-webpack-plugin
new ExtraWatchWebpackPlugin({ files: [ './node_modules/uikit/fesm2015/mymodule.js' ] }),
I'm running out of ideas here.