[英]How to make web-mode read mjs-files in Emacs
I'm trying to get web-mode to read mjs-files as jsx or js files. 我正在尝试使网络模式将mjs文件读取为jsx或js文件。 I did this by adding
我通过添加
(add-to-list 'auto-mode-alist '("\\.mjs\\'" . web-mode))
The problem is when I eval web-mode-content-type
, I get html
. 问题是当我评估
web-mode-content-type
,我得到了html
。 How do I fix this? 我该如何解决?
I fixed my issue by adding the following to my init file. 我通过将以下内容添加到初始化文件中解决了我的问题。
(setq web-mode-content-types-alist
'(("jsx" . "\\.[c|m]js[x]?\\'")))
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.