在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問(wèn)答/HTML/ nodejs 報(bào)錯(cuò): SyntaxError: Unexpected token

nodejs 報(bào)錯(cuò): SyntaxError: Unexpected token {

服務(wù)端中渲染react的時(shí)候,組件引用css文件報(bào)錯(cuò)

import './index.css'
SyntaxError: D:/code/node/my-express-react-reactRouter/src/components/header/index.css: Unexpected token, expected ; (1:5)
> 1 | html {
    |      ^
  2 |   background: red;
  3 | }
  4 | 

該怎么解決?

回答
編輯回答
無(wú)標(biāo)題

已解決
在服務(wù)端入口使用了一個(gè)css的鉤子就沒(méi)報(bào)錯(cuò)了,具體原因不

require('css-modules-require-hook')({
  extensions: ['.css'],
  generateScopedName: '[name]__[local]-[hash:base64:8]',
});

參考代碼https://stackoverflow.com/que...

2017年8月9日 04:49