Comments (5)
This is what worked for me to make sure my js/chunk-vendors.hash.js
is not obfuscated since it's by far the largest file
const obfuscatorPlugin = new JavaScriptObfuscator({
rotateUnicodeArray: true,
}, [
'**/chunk-vendors.*.js',
]);
from webpack-obfuscator.
You need to create two separate bundles, one with your one code and one with the node_modules. Then you tell the obfuscator to ignore the node_modules bundle.
Add the following to your webpack config to create different bundles for your own code and for libraries.
optimization: {
splitChunks: {
cacheGroups: {
vendor: {
test: /node_modules/,
chunks: 'initial',
name: 'vendor',
enforce: true
},
}
}
},
And then tell the obfuscator to ignore the node_modules bundle with:
new JavaScriptObfuscator({
}, ['**_vendor.js'])
You might have to change '**_vendor.js' to fit your filenames
from webpack-obfuscator.
@techterbium Excludes are on the generated files. Not on the original source files.
from webpack-obfuscator.
I just ran into this problem. I tried to configure excludes
to ignore all node_modules but it did not work.
new JavaScriptObfuscator({
compact: true,
controlFlowFlattening: true,
controlFlowFlatteningThreshold: 0.75,
deadCodeInjection: true,
log: false,
rotateUnicodeArray: true
}, ['node_modules/**/*.js'])
Can you help me with working example?
from webpack-obfuscator.
Closed as old. Fell free to create a new issue.
from webpack-obfuscator.
Related Issues (20)
- Is there any option that can output the filename matched by webpack-obfuscator loader in the console?
- does webpack-obfuscator support nuxtjs3 ?
- Obfuscate method names in objects/classes. HOT 1
- hashes are breaking chunk loading when using "split strings" or "medium" preset
- Compatibility with Module Federation plugin
- DOMException: Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.
- Loader doesn't work, but plugin does HOT 2
- webpack-obfuscator is not generating sourcemaps HOT 4
- Is there a Vue framework use case?
- webpack-obfuscator not working on Firebase deployment HOT 1
- webpack > 5 it's not working
- Webpack version compatible
- cannot read property of undefined reading sourceAndMap
- Security.md file?
- how to obfuscate select multiple .vue file in nuxt2
- help with excluding a 10mb file from obfuscation
- Exclude files
- use webpack-obfuscator in Vue has a error when build the vue project
- Obfuscation doesn't work on ionic angular mobile iOS app
- Does it work with CSS?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from webpack-obfuscator.