zjunebao
4/8/2019 - 11:04 AM

webpack install

npm

npm init -y

npm i -D @babel/core @babel/preset-env autoprefixer node-sass cssnano clean-webpack-plugin mini-css-extract-plugin babel-loader css-loader file-loader img-loader postcss-loader sass-loader style-loader url-loader webpack webpack-cli

babelrc

{
    "presets": [
        "@babel/preset-env"
    ]
}

postcss

// postcss.config.json
module.exports = {
    plugins: [
        require("autoprefixer"),
        require("cssnano")({
            zindex: false
        })
    ]
}

webpack

// webpack.config.js