[purge-icons-webpack-plugin] TypeError: PurgeIconsPlugin is not a constructor
See original GitHub issueI use purge-icons-webpack-plugin, but throw TypeError: PurgeIconsPlugin is not a constructor
error:
const PurgeIconsPlugin = require('purge-icons-webpack-plugin')
module.exports = {
// ...options
plugins: [
new PurgeIconsPlugin({
/* PurgeIcons Options */
})
]
}
Later I changed this code to run:
const PurgeIconsPlugin = require('purge-icons-webpack-plugin').default
// ...
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
'Purgecss is not a constructor' when following the JS API ...
Hi, I'm trying to follow the ES5 JS API examples but it looks like something is going wrong with the export as I'm...
Read more >Webpack 5 - PurgeCss - Not a Constructor Error
So apparently this is a webpack-purgecss-plugin 5.0 issue since webpack 5.0 So I downgraded the plugin to 4.1.3 and it works again.
Read more >purgecss-webpack-plugin - npm
PurgeCSS plugin for webpack - Remove unused css. ... TypeScript icon, indicating that this package has built-in type declarations.
Read more >PurgeCSSPlugin.(constructor)
PurgeCSSPlugin.(constructor). Constructs a new instance of the PurgeCSSPlugin class. Signature: constructor(options: UserDefinedOptions); ...
Read more >Eliminating Unused CSS - SurviveJS
The functionality can be enabled through purgecss-webpack-plugin. At best, PurgeCSS can eliminate most, if not all, unused CSS rules. Critical path rendering is ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Added in
v0.4.1
. It’s backward compatible, so the existing.default
should also work.Guys, what do you think if we change the API to: