如何使用autoprefixer外部css文件 - webpack

时间:2017-03-07 04:00:31

标签: css web build webpack autoprefixer

我在${ROOT}/resource/css/内有所有css文件。在使用webpack构建时,我想将所有css文件复制到${ROOT}/build/css/,并将所需的供应商前缀添加到所有css规则中。 目前我正在使用copywebpackplugin将所有css文件复制到${ROOT}/build/css/。我正在努力添加添加一个步骤来添加供应商前缀。请帮忙。

在我的webpack配置下面:

config = {
    entry: {
        "new": "./resources/js/new",
        "view": "./resources/js/view",
        "edit": "./resources/js/edit",
        "preview": "./resources/js/preview",
        "sidebar": "./resources/js/sidebar",
        "frame": "./resources/js/frame"
    },
    output: {
        filename: "[name].js",
        path: "build/js"
    },
    module: {
        loaders: [
            {test: /\.js$/, loaders: ["babel-loader", "eslint-loader"]}
        ]
    },
    plugins: [
        new CopyWebpackPlugin([{
            from: './resources/css/*.css',
            to: './build/css/[name].css'
        }])
    ]
}

0 个答案:

没有答案