[英]Webstorm SystemJS import resolve error
SystemJS makes it possible to specify what kind of content is rendered from the imported files: SystemJS使得可以指定从导入的文件呈现什么样的内容:
System.import('my/file.css!')
System.import('my/file.css!')
System.import('some/image.png!image')
System.import('some/image.png!image')
System.import('some/data.json!').then(function(json){})
System.import('some/data.json!').then(function(json){})
System.import('some/text.txt!text').then(function(text) {})
System.import('some/text.txt!text').then(function(text) {})
Using SystemJS, importing from a file with a type appended, gives an error in Webstorm. 使用SystemJS从具有附加类型的文件导入时,Webstorm中出现错误。
So when I do this: 所以当我这样做时:
import template from './404.template.html!text';
meaning I need the html file in plain text, Webstorm shows an error saying: 这意味着我需要纯文本格式的html文件,Webstorm会显示一条错误消息:
Cannot resolve file '404.template.html!text'
无法解析文件“ 404.template.html!text”
showing red underlines throughout all of my project file structure tree. 在我的所有项目文件结构树中都显示红色下划线。
How can I get Webstorm to only resolve the part before the !
我如何才能使Webstorm仅解决
!
之前的部分!
? ?
不幸的是,设置为JSX Harmony
在WebStorm 11中不再起作用。
After submitting an bug report on the JetBrains issue tracker, I got an answer which suggested that I should: 在通过JetBrains问题跟踪器提交错误报告后,我得到了一个答案,建议我:
Change JavaScript language version to
JSX harmony
in将JavaScript语言版本更改为
JSX harmony
Settings
>Languages & Frameworks
>JavaScript
Settings
>Languages & Frameworks
>JavaScript
Mine was on ECMAScript 6
which I thought was the right one... 我的是
ECMAScript 6
,我认为这是正确的...
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.