0
votes

I am getting this warning when compiling an angular universal app:

Warning: Entry point 'my-module' contains deep imports into '/src/app/mocks/myModule.ts'. This is probably not a problem, but may cause the compilation of entry points to be out of order.

I have a paths change in tsconfig, which works and is my desired functionality. I would like to be able to disable this particular warning. I assume there is some change I can make to tslint.json to allow deep imports all together, or to allow it in this particular case.

ESlint seems to have nx-enforce-module-boundaries, but I don't think that is applicable to me since this project uses TSLint. However, I tried it anyway with no success:

{
  "extends": "tslint:recommended",
  "rules": {
    "nx-enforce-module-boundaries": [
      true,
      {
        "allow": [
          ["/src/app/mocks/myModule.ts"]
        ]
      }
    ],
    ...

I can't find anything in TSLint Rules that seem to help me. Any ideas?

1
This isn't relevant to Nx as this warning is coming from the Angular CLI (and possibly webpack). It's also not coming from TSLint, so changing that config won't help you.Splaktar

1 Answers

0
votes

I ended up just using a custom webpack, as I could not figure out how to disable to warning. Webpack has no deep-import warnings:

module.exports = {
    plugins: [
        new webpack.NormalModuleReplacementPlugin(/^myModule$/, path.join(__dirname, './src/app/mocks/myModule.mock.server.ts')),
    ]
}

https://github.com/just-jeb/angular-builders/tree/master/packages/custom-webpack