file-extract-loader

1.0.0 • Public • Published

file-extract-loader

代替(扩展)file-loader,结合extract-text-webpack-plugin运用,处理extract-text-webpack-plugin抽出css文件后,css文件内路径不对的问题。

Install

npm install --save-dev file-extract-loader

webpack.config.js

 
var cssPath="css-path";
var cssExtract = new ExtractTextPlugin(cssPath+'/[name].css');
 
module.exports = {
  module: {
    rules: [
      {
        test: /\.(png|jpg|gif)$/,
        use: [
          {
            loader: 'file-extract-loader',
            options: {
        name: '[name].[ext]?[hash]',
        relativePath:cssPath
        }  
          }
        ]
      }
    ]
  }
}

Readme

Keywords

none

Package Sidebar

Install

npm i file-extract-loader

Weekly Downloads

0

Version

1.0.0

License

ISC

Last publish

Collaborators

  • anderpang