javascript - Webstorm SystemJS 导入解决错误

标签 javascript webstorm ecmascript-6 systemjs

SystemJS 可以指定从导入的文件中呈现哪种内容:

  • CSS System.import('my/file.css!')
  • 图片 System.import('some/image.png!image')
  • JSON System.import('some/data.json!').then(function(json){})
  • Text System.import('some/text.txt!text').then(function(text) {})

( Source )


使用 SystemJS,从附加类型的文件导入,在 Webstorm 中会出错。
所以当我这样做时:

import template from './404.template.html!text';

意味着我需要纯文本的 html 文件,Webstorm 显示一条错误消息:

Cannot resolve file '404.template.html!text'

在我所有的项目文件结构树中显示红色下划线。

我怎样才能让 Webstorm 只解析之前 ! 的部分?

最佳答案

不幸的是,设置为 JSX Harmony 在 WebStorm 11 中不再有效。

关于javascript - Webstorm SystemJS 导入解决错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28496944/

相关文章:

javascript - AngularJS + TypeScript : Uncaught TypeError: Cannot read property 'module' of undefined

javascript - 在 Web 浏览器环境中执行时,JavaScript 是否被编译为机器代码?

javascript - ReactJS 处于开发模式

javascript - 单个解构赋值,用于从 RegExp.exec() 返回的结果中获取值

javascript - 重置 UIWebView 中访问过的链接,iOS 5

angularjs - Webstorm karma/jasmine angularjs 测试 - 引用错误模块未定义

javascript - WebStorm 无法在单个文件上正确切换

intellij-idea - 如何在 WebStorm 中获取 Atom 键绑定(bind)?

javascript - 在 ES6 中使链表可迭代

javascript - 在 jQuery UI 对话框中的表单中调用 Parsley.js 时,错误消息未出现?