webpack-obfuscator doesn't work with favicons-webpack-plugin
See original GitHub issueTrying to use this awesome obfuscator with my project I was getting the following error:
/home/ezze/Development/geoport/node_modules/inversify/lib/planning/metadata_reader.js:8
var compilerGeneratedMetadata = Reflect.getMetadata(METADATA_KEY.PARAM_TYPES, constructorFunc);
^
TypeError: Reflect.getMetadata is not a function
at MetadataReader.getConstructorMetadata (/home/ezze/Development/geoport/node_modules/inversify/lib/planning/metadata_reader.js:8:49)
at getTargets (/home/ezze/Development/geoport/node_modules/inversify/lib/planning/reflection_utils.js:15:35)
at Object.getDependencies (/home/ezze/Development/geoport/node_modules/inversify/lib/planning/reflection_utils.js:10:19)
at /home/ezze/Development/geoport/node_modules/inversify/lib/planning/planner.js:106:51
at Array.forEach (<anonymous>)
at _createSubRequests (/home/ezze/Development/geoport/node_modules/inversify/lib/planning/planner.js:94:20)
at Object.plan (/home/ezze/Development/geoport/node_modules/inversify/lib/planning/planner.js:129:9)
at /home/ezze/Development/geoport/node_modules/inversify/lib/container/container.js:243:37
at Container._get (/home/ezze/Development/geoport/node_modules/inversify/lib/container/container.js:236:44)
at Container.get (/home/ezze/Development/geoport/node_modules/inversify/lib/container/container.js:195:21)
at e.value (/home/ezze/Development/geoport/node_modules/javascript-obfuscator/dist/webpack:/src/container/InversifyContainerFacade.ts:126:34)
at Function.value (/home/ezze/Development/geoport/node_modules/javascript-obfuscator/dist/webpack:/src/JavaScriptObfuscatorFacade.ts:26:17)
at /home/ezze/Development/geoport/node_modules/webpack-obfuscator/index.js:49:66
at Array.forEach (<anonymous>)
at Compilation.<anonymous> (/home/ezze/Development/geoport/node_modules/webpack-obfuscator/index.js:27:23)
at Compilation.applyPluginsAsyncSeries (/home/ezze/Development/geoport/node_modules/webpack/node_modules/tapable/lib/Tapable.js:206:13)
Finally I narrowed the problem and stated that this one happens when both favicons-wepback-plugin and obfuscator plugin are used. I use favicons-webpack-plugin
with html-webpack-plugin and html-webpack-template this way:
new HtmlPlugin({
filename: path.resolve(__dirname, 'dist/index.html'),
inject: false,
template: htmlTemplate,
title: 'RIPI GeoPort',
meta: [{
'http-equiv': 'Cache-Control',
content: 'no-cache, no-store, must-revalidate'
}, {
'http-equiv': 'Pragma',
content: 'no-cache'
}, {
'http-equiv': 'Expires',
content: '0'
}],
appMountId: 'container',
scripts: ['cesium/Cesium.js'],
minify: {
collapseWhitespace: NODE_ENV === 'production'
}
}),
new FaviconsWepbackPlugin(
path.resolve(__dirname, 'src/favicon.png')
)
What is the reason of this error and is it possible to solve it?
My environment: Ubuntu 16.04 LTS Node 8.9.4 Webpack 3.8.1
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
Exclude in webpack-obfuscator does not work - Stack Overflow
In the end, we just want to exclude node_modules from obfuscation). The versions javascript-obfuscator (4.0.0) and webpack-obfuscator (3.5.1) ...
Read more >favicons-webpack-plugin-ico-fix - npm
Start using favicons-webpack-plugin-ico-fix in your project by running `npm i ... (By default the context is the current working directory).
Read more >favicons-webpack-plugin examples - CodeSandbox
Learn how to use favicons-webpack-plugin by viewing and forking example apps that make use of favicons-webpack-plugin on CodeSandbox. @bpiwek/frontbox.
Read more >webpack-obfuscator - npm Package Health Analysis - Snyk
Learn more about webpack-obfuscator: package health score, popularity, ... No known security issues ... npm i snyk -g && snyk test webpack-obfuscator.
Read more >webpack-obfuscator/readme.md - UNPKG
The CDN for webpack-obfuscator. ... 51, AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE. 52, IMPLIED WARRANTIES OF MERCHANTABILITY ......
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
Hi. Try to reinstall
favicons-webpack-plugin
plugin.harmony-reflect
just was updating to1.6.0
version and this bug was fixed.So,
harmony-reflect
has differentReflect API
thanreflect-metadata
. https://github.com/tvcutsem/harmony-reflect/blob/master/doc/api.mdI can’t just add condition to the loading of
reflect-metadata
like this:So, current way is to use different plugin to generate favicons.