简体   繁体   中英

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. 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 . 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]?\\'")))

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM