Skip to content

🚽 This plugin for webpack gets all bundled CSS chunks and injects them globally into window.__CSS_CHUNKS__ for babel-plugin-dual-import to be read

License

Notifications You must be signed in to change notification settings

m4r1vs/webpack-flush-chunks-html

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Webpack Flush Chunks HTML 🚽

NPM Version NPM Downloads License: MIT
This plugin for webpack gets all bundled CSS chunks and injects them globally into window.__CSS_CHUNKS__ for babel-plugin-dual-import to be read:
<coded/> with ❤︎ and ☕ by Marius Niveri


Getting started 🚀

# install via npm:
npm i webpack-flush-chunks-html --save-dev
# or use yarn:
yarn add webpack-flush-chunks-html -D
const WebpackFlushChunksPlugin = require('webpack-flush-chunks-html')

plugins: [
	new WebpackFlushChunksPlugin({
		/* options (see below) */
	})
]

Options 🔧

You can pass following options to the plugin:

  • extensions: The file extensions to be included (default: ['css']).
  • excludedChunks: chunks to be excluded (default: ['main']).
  • variable: In case you want to append the files to a different variable (default: __CSS_CHUNKS__).
  • inject: 'head' | 'body' Where to inject the <script></script> in the html (default: body). But can also be another HTML element, a warning will be thrown though.
  • log: true | false if true debug information will be logged (default: false).
  • warn: true | false if true warnings will be logged (default: true)

About

🚽 This plugin for webpack gets all bundled CSS chunks and injects them globally into window.__CSS_CHUNKS__ for babel-plugin-dual-import to be read

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published