Skip to content
This repository has been archived by the owner on Dec 1, 2019. It is now read-only.

'Cannot find module' when compile from node_modules #636

Open
olgadolg opened this issue Jun 9, 2019 · 0 comments
Open

'Cannot find module' when compile from node_modules #636

olgadolg opened this issue Jun 9, 2019 · 0 comments

Comments

@olgadolg
Copy link

olgadolg commented Jun 9, 2019

My app compiles, but if add it to node_modules, I can't use
import * as styles from './styles.scss';
(need to compile together)

tsconfig:

  "compilerOptions": {
    "noImplicitAny": false,
    "outDir": "./dist/",
    "baseUrl": "./src",
    "resolveJsonModule": true,
    "module": "es6",
    "target": "esnext",
    "moduleResolution": "node",
    "jsx": "react",
    "allowJs": true,
    "experimentalDecorators": true
  },
  "include": [
    "./src/**/*"
  ],
  "exclude": [
    "node_modules/!(@my)",
    "**/*.js",
    "**/*.jsx"
  ]
}

definition.d.ts (in my-app):

    const content: Object;
    export = content;
}
declare module '@my/services/utils';

'@my/services/utils' works fine

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant