jorgebucaran / classcat

Build a class attribute string quickly
MIT License
905 stars 22 forks source link

imported could not be resolved #20

Closed z543 closed 6 years ago

z543 commented 6 years ago
// Install with npm
npm i classcat
// foo.tsx
import classcat from 'classcat'

bundle with rollup(transpile with typescript)

show warning: 'classcat' is imported by src\js\foo.tsx, but could not be resolved – treating it as an external dependency

no problem with other import

jorgebucaran commented 6 years ago

@z543 I have no idea. This is probably an error in your rollup configuration. Do you have a sample project I can clone and check myself?

z543 commented 6 years ago

it seems my mistake, I change code to

import classcat from 'classcat/src/index.js'

not warning

jorgebucaran commented 6 years ago

@z543 That sounds like an issue in how tsc is resolving the baseUrl. Can you show me your tsconfig.json?

z543 commented 6 years ago

sorry, it still my fault.

according to treating-module-as-external-dependency

I add plugin 'rollup-plugin-node-resolve', and there is no problem

jorgebucaran commented 6 years ago

@z543 So, is it solved?

z543 commented 6 years ago

yes

jorgebucaran commented 6 years ago

🎉🎉