easy-team / egg-react-webpack-boilerplate

Egg React Server Side Render(SSR) / Client Sider Render(CSR)
https://easyjs.cn/egg-react
MIT License
671 stars 93 forks source link

怎么配置css的sourceMap? #28

Closed EvanLiu2968 closed 5 years ago

EvanLiu2968 commented 5 years ago

feature: 需要配置生成css的sourceMap,定位到源码

loaders: {
    css: {
      options:{
        sourceMap: true
      }
    },
    less:{
      options:{
        javascriptEnabled: true,
        sourceMap: true
      }
    }
  }

这样不生效,不知道是不是在mini-css插件中配置?

hubcarl commented 5 years ago

@EvanLiu2968 webpack.config.js 设置 devtool: 'eval' 就行 这个只在开发模式生效

hubcarl commented 5 years ago

image https://www.yuque.com/easy-team/easywebpack/base

EvanLiu2968 commented 5 years ago

@hubcarl js的sourceMap一直是开启的,只是最近想开启css的sourceMap一直没法配置 我试了devtool的设置,包括css-loader和less-loader配置sourceMap为true postcss.config.js也试了sourceMap设为true,但是都没有成功,不知道有没有办法

EvanLiu2968 commented 5 years ago

@hubcarl 刚刚试了发现又有了css的sourceMap,不过只有设置成"source-map"才行,"eval" "eval-source-map"都只有js生效 所以如果要开启css的的source-map只能设置dev-tool为source-map,不知道会有多少性能损失?

hubcarl commented 5 years ago

@EvanLiu2968 感谢反馈