Webpack packaging ignores CSS and the pit of autoprefixer

Time:2021-12-1

Today, when packaging Vue projects with webpack, I found that multiple lines of ellipsis code had not been executed, dev was normal, and the test environment could not be packaged. I thought there was a cache. Finally, I found – WebKit Box Oriented: vertical in the packaged CSS code; Automatically ignored
It was found to be the pot of autoprefixer

autoprefixer

Autoprefixer will not only help you add prefixers such as WebKit,
It will also help you delete the styles you wrote in CSS / sass / less,
That’s great

Turn off the automatic deletion function of autoprefixer, so that

/*! autoprefixer: off */
-webkit-box-orient: vertical;
/*! autoprefixer: on */

The middle sentence wrapped with comments will not be deleted

Remember to add! What you find online is not added! The result is invalid