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
I'm shimming a file called "Foo.js". This file is local and it's path relative to my entry file is "../FolderB/Foo.js". With the following configuration I am able to shim it:
"browserify-shim": {
"Foo": "global:Foo"
}
And then I imported it with
import Foo from 'Foo'
This works fine with Browserify, but the IDE gets confused and tells me "Module is not installed".
Is there any way to specify the absolute path to the file in browserify-shim config and make it recognize the relative import from my entry file so both Browserify-shim and the IDE are happy?
The text was updated successfully, but these errors were encountered:
I don't think so. Is there a reason you're not using a proper relative path, i.e. ./foo? This is important to distinguish between registry/builtin packages and local modules.
I don't think so. Is there a reason you're not using a proper relative path, i.e. ./foo? This is important to distinguish between registry/builtin packages and local modules.
Yeah, well the reason behind that is that I cannot get the shim to work with a relative path but probably I'm doing something wrong. This is how I would like to import and how the IDE likes it too:
With all the above options, the shim doens't work. I verified this by looking in the output javascript file. With the configuration as explained in my first post, the whole class inside Foo disappears from the output which is what I expect.
Hi,
I'm shimming a file called "Foo.js". This file is local and it's path relative to my entry file is "../FolderB/Foo.js". With the following configuration I am able to shim it:
And then I imported it with
import Foo from 'Foo'
This works fine with Browserify, but the IDE gets confused and tells me "Module is not installed".
Is there any way to specify the absolute path to the file in browserify-shim config and make it recognize the relative import from my entry file so both Browserify-shim and the IDE are happy?
The text was updated successfully, but these errors were encountered: