Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.0.0 SourceMap not working in build mode #5120

Closed
RunningCoderLee opened this issue Sep 27, 2018 · 1 comment
Closed

2.0.0 SourceMap not working in build mode #5120

RunningCoderLee opened this issue Sep 27, 2018 · 1 comment

Comments

@RunningCoderLee
Copy link

Is this a bug report?

yes

Did you try recovering your dependencies?

yes

Environment

System:
OS: macOS 10.14
CPU: x64 Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz
Binaries:
Node: 10.9.0 - ~/.nvm/versions/node/v10.9.0/bin/node
Yarn: 1.9.4 - /usr/local/bin/yarn
npm: 6.4.1 - ~/.nvm/versions/node/v10.9.0/bin/npm
Browsers:
Chrome: 69.0.3497.100
Firefox: 62.0
Safari: 12.0
npmPackages:
react: ^16.5.2 => 16.5.2
react-dom: ^16.5.2 => 16.5.2
react-scripts: 2.0.0 => 2.0.0
npmGlobalPackages:
create-react-app: 2.0.0

Steps to Reproduce

(Write your steps here:)

  1. create-react-app my-react --scripts-version=@next
  2. yarn build

Expected Behavior

generate .css.map file

Actual Behavior

not generate .css.map file

@RunningCoderLee
Copy link
Author

This problem Looks like caused by optimize-css-assets-webpack-plugin, when I modify the configuration as below, it works for me

new OptimizeCSSAssetsPlugin({
  cssProcessorOptions: { 
    parser: safePostCssParser,
    map: {
      inline: false,
      annotation: true
    }
  },
})

refs:
webpack-contrib/mini-css-extract-plugin#141
NMFR/optimize-css-assets-webpack-plugin#53

@gaearon gaearon added this to the 2.0.0 milestone Sep 27, 2018
@lock lock bot locked and limited conversation to collaborators Jan 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants