You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Flow allows referencing types from other file with a syntax similar to ES6 imports: http://flowtype.org/blog/2015/02/18/Import-Types.html. These types (just like any other flow declarations) have no effect on runtime.
However, it seems like babelify doesn't prevent browserify from fetching and including modules referenced in this way. Expected behaviour would be to ignore import type statements.
$ echo "import type {Type1} from 'my-lib'" | ./node_modules/.bin/browserify -t [ babelify --plugins [ transform-flow-strip-types ] ] -
Error: Cannot find module 'my-lib' from '/my-project'
at /my-project/node_modules/browserify/node_modules/resolve/lib/async.js:46:17
at process (/my-project/node_modules/browserify/node_modules/resolve/lib/async.js:173:43)
at ondir (/my-project/node_modules/browserify/node_modules/resolve/lib/async.js:188:17)
at load (/my-project/node_modules/browserify/node_modules/resolve/lib/async.js:69:43)
at onex (/my-project/node_modules/browserify/node_modules/resolve/lib/async.js:92:31)
at /my-project/node_modules/browserify/node_modules/resolve/lib/async.js:22:47
at FSReqWrap.oncomplete (fs.js:82:15)
Flow allows referencing types from other file with a syntax similar to ES6 imports: http://flowtype.org/blog/2015/02/18/Import-Types.html. These types (just like any other flow declarations) have no effect on runtime.
However, it seems like
babelify
doesn't preventbrowserify
from fetching and including modules referenced in this way. Expected behaviour would be to ignoreimport type
statements.Tested with latest versions:
The text was updated successfully, but these errors were encountered: