Conversation
If you wish to ignore .jsx files, you can explicitly define that in a regex in the dontLoad option
|
I tried this, but I can't get it to work. What does your |
| for (var prop in this.modules) { | ||
| if (prop != parentFile && filter(path, prop, query)) { | ||
| if (/\.js$/.test(prop)) prop = prop.slice(0, prop.length - 3) | ||
| if (/\.jsx?$/.test(prop)) prop = prop.slice(0, prop.length - 3) |
There was a problem hiding this comment.
There must be prop.length - 4 because length(".jsx") = 4.
There was a problem hiding this comment.
It can be either 3 or 4, so jou would need two different if statements
There was a problem hiding this comment.
and 'else if' is also appreciated because it won't work with "foo.jsx.js" file name.
There was a problem hiding this comment.
Preferably, just store the regexp match and use match[0].length to get its actual length
There was a problem hiding this comment.
I found replace to work well here:
e.g.
prop = prop.replace(/.jsx?/, '')
|
Hi! |
|
@marijnh Can I help with something ... maybe update PR? I really like tern and would like to use it :) |
|
I just used the webpack plugin as I use that anyway, so I didn't have a need for this anymore. |
|
@JelteF can you describe it more? So my .tern-project files looks like this: webpack.config: Webpack plugin helps tern resolve webpack's aliases, but tern still doesn't see .jsx files. Though it became to see them after .jsx files got edited and saved. |
If you wish to ignore .jsx files, you can explicitly define that in a regex in the dontLoad option