Skip to content

mankowsj/webpack-custom-public-path-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

webpack-custom-public-path-plugin

This plugin is supposed to solve the problematic thing which is inability to change publicPath for css files only when lazy loading them using MiniCssExtractPlugin.

Compatibility

Tested only with Webpack@4.28.4 and MiniCssExtractPlugin@0.8.0 but should be comapitible with any Webpack@4.x. Please bear in mind that this plugin heavily relies on code generated by MiniCssExtractPlugin. If the code responsible for lazy loading css chunks changes, this plugin would probably stop working till next update.

Example usage

config.plugins = [
  new CustomPublicPath({
    cssPublicPath: function doPath(href, webpackPublicPath) {
      return 'custom/path/to/lazy/css/' + href;
    }
  })
];
config.plugins = [
  new CustomPublicPath({
    cssPublicPath: 'custom/path/'
  })
];

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published