react-app-rewired icon indicating copy to clipboard operation
react-app-rewired copied to clipboard

autoprefixer no effect!please give me help

Open chengwangping opened this issue 8 years ago • 5 comments

image

3814

chengwangping avatar Aug 03 '18 03:08 chengwangping

image

chengwangping avatar Aug 03 '18 03:08 chengwangping

Are you intending to replace all the existing options, or to add the importLoaders variable into the options field - because at the moment you are completely replacing them? If you're trying to add it to the existing list of options, you need to include the existing options too.

loader.options = {
  ...loader.options,
  importLoaders: 2
}

dawnmist avatar Aug 03 '18 03:08 dawnmist

@dawnmist Sorry, I still have the same problem after I am modified. image

image

image

chengwangping avatar Aug 03 '18 04:08 chengwangping

Are you testing this in Development mode, or with a Production build? Do you have a browserslist definition in your package.json file?

The default browserslist configuration is here: https://github.com/facebook/create-react-app/blob/69c3d4b04c233ba9fb9d16691056bd09076177b1/packages/react-scripts/package.json#L82-L94

The targetted browsers in development mode using the default browserslist don't need any prefixes for display: flex, so none will be added.

In the Production build, you should get display: -ms-flexbox added if I've read the details correctly. React-scripts sets the {flexbox: 'no-2009'} option when initializing autoprefixer, so the display: -webkit-box should not be created.

dawnmist avatar Aug 03 '18 05:08 dawnmist

@dawnmist hank you very much for your patience and help me.

chengwangping avatar Aug 03 '18 06:08 chengwangping