Comments (16)
seems like it is a bug with [email protected]
which will be fixed in javascript-obfuscator@beta
(webpack-obfuscator
intalls stable release 0.7.3
).
You can try to npm i javascript-obfuscator@beta
.
Anyway i very recommend to exclude all vendors and polyfills assets from obfuscation by adding following array as second plugin argument.
new JavaScriptObfuscator ({
rotateUnicodeArray: true
}, ['vendor.*.js', 'polyfills.*.js']),
from webpack-obfuscator.
Thanks, however, seems after following your advice I still get an error:
main.5901d2c….bundle.js:1 Uncaught SyntaxError: Undefined label '0x39aca5'
at webpack_require (http://127.0.0.1:8080/polyfills.6aacd2a7ce9d29ab76f3.bundle.js:1:119)
at Object. (http://127.0.0.1:8080/main.5901d2ce226c3fb0c5c8.bundle.js:1:1774155)
at webpack_require (http://127.0.0.1:8080/polyfills.6aacd2a7ce9d29ab76f3.bundle.js:1:119)
at Object. (http://127.0.0.1:8080/main.5901d2ce226c3fb0c5c8.bundle.js:1:1709558)
at webpack_require (http://127.0.0.1:8080/polyfills.6aacd2a7ce9d29ab76f3.bundle.js:1:119)
at Object. (http://127.0.0.1:8080/main.5901d2ce226c3fb0c5c8.bundle.js:1:1705643)
at webpack_require (http://127.0.0.1:8080/polyfills.6aacd2a7ce9d29ab76f3.bundle.js:1:119)
at Object. (http://127.0.0.1:8080/main.5901d2ce226c3fb0c5c8.bundle.js:1:1674853)
at webpack_require (http://127.0.0.1:8080/polyfills.6aacd2a7ce9d29ab76f3.bundle.js:1:119)
at Object. (http://127.0.0.1:8080/main.5901d2ce226c3fb0c5c8.bundle.js:1:3018755)__webpack_require_ @ polyfills.6aacd2a….bundle.js:1(anonymous function) @ main.5901d2c….bundle.js:1__webpack_require__ @ polyfills.6aacd2a….bundle.js:1(anonymous function) @ main.5901d2c….bundle.js:1__webpack_require__ @ polyfills.6aacd2a….bundle.js:1(anonymous function) @ main.5901d2c….bundle.js:1__webpack_require__ @ polyfills.6aacd2a….bundle.js:1(anonymous function) @ main.5901d2c….bundle.js:1__webpack_require__ @ polyfills.6aacd2a….bundle.js:1(anonymous function) @ main.5901d2c….bundle.js:1__webpack_require__ @ polyfills.6aacd2a….bundle.js:1(anonymous function) @ main.5901d2c….bundle.js:1__webpack_require__ @ polyfills.6aacd2a….bundle.js:1(anonymous function) @ main.5901d2c….bundle.js:1__webpack_require__ @ polyfills.6aacd2a….bundle.js:1(anonymous function) @ main.5901d2c….bundle.js:1__webpack_require__ @ polyfills.6aacd2a….bundle.js:1(anonymous function) @ main.5901d2c….bundle.js:1__webpack_require__ @ polyfills.6aacd2a….bundle.js:1(anonymous function) @ main.5901d2c….bundle.js:1__webpack_require__ @ polyfills.6aacd2a….bundle.js:1window.webpackJsonp @ polyfills.6aacd2a….bundle.js:1(anonymous function) @ main.5901d2c….bundle.js:1
When I look in node_modules/javascript-obfuscator, I got:
"_from": "javascript-obfuscator@beta",
"_id": "[email protected]",
So I suppose it installed and executed the beta...
from webpack-obfuscator.
By the way, thanks for the crazy fast replies ;-)
from webpack-obfuscator.
Look. Syntax for excludes bundles array (['vendor.*.js', 'polyfills.*.js']
) is syntax for minimatch package: https://www.npmjs.com/package/minimatch
Value - filepath of each bundle and this filepath is combination of entry
name and output.filename
pattern.
So. array value should match webpack config output name for any entry. For example if your webpack.config.js
looks like
{
entry: {
main: './resources/assets/typescript/main.ts',
vendor: './resources/assets/typescript/vendor.ts',
styles: './resources/assets/less/app.less'
},
// config
output: {
path: './public',
filename: 'js/[name].[chunkhash].js'
}
}
and you want to exclude vendor
and styles
entries you should add following values to array:
new JavaScriptObfuscator ({
rotateUnicodeArray: true
}, ['**/vendor.*.js', '**/styles.*.js']),
because filepath for vendor
bundle was like `js/vendor.6aacd2a.js'
so
**/
matches filename: js/[name].[chunkhash].js
vendor.
matches js/[name].[chunkhash].js
*
matches js/[name].[chunkhash].js
.js
matches js/[name].[chunkhash].js
from webpack-obfuscator.
I updated my previous comment with more detailed explanation.
from webpack-obfuscator.
Also can you upload your project or source code of this file without obfuscation? I will look at error. It very strange, because i testing obfuscator on my angular repo https://github.com/sanex3339/laravel-5-angular-2-example and have no errors.
from webpack-obfuscator.
Seems it is indeed not working specifically for me:
if I do:
new JavaScriptObfuscator ({
rotateUnicodeArray: true
}, [
'**/vendor.*.js',
'**/polyfills.*.js',
'**/assets/**',
//'**/main.*.js'
]),
it works.
However, if I remove the comment for main (so enable obfuscation for it), I get the error I mentioned earlier.
I'm sorry, I cannot upload the project as it is proprietary. (which is why I have to obfuscate it...)
Thanks however for all the help.
from webpack-obfuscator.
Show me error when you obfuscate only main.js
please. Can you remove all important code from main.js
bundle and left only small placeholder class and if after that error will be still exist - sent it to me? I should reproduce error.
from webpack-obfuscator.
Hey Sanex, I've sent you a mail.
greetz
from webpack-obfuscator.
I didn't recieve your mail
from webpack-obfuscator.
ok, I tried again, to [email protected] , changed .js to .js.txt
from webpack-obfuscator.
can you send this files without obfuscation?
from webpack-obfuscator.
Looks wrong
from webpack-obfuscator.
Fixed in javascript-obfuscator@beta
and webpack-obfuscator@beta
.
Commit: javascript-obfuscator/javascript-obfuscator@d444195
Installation npm i webpack-obfuscator@beta
webpack-obfuscator@beta
- special version with javascript-obfuscator@beta
dependency.
When [email protected]
will be ready, you should install webpack-obfuscator@latest
from webpack-obfuscator.
Ok, cool thanks
From: Timofey Kachalov [mailto:[email protected]]
Sent: maandag 14 november 2016 19:21
To: javascript-obfuscator/webpack-obfuscator [email protected]
Cc: LanderBeeuwsaert [email protected]; State change [email protected]
Subject: Re: [javascript-obfuscator/webpack-obfuscator] angular2-webpack-starter issue? (#8)
Fixed javascript-obfuscator/javascript-obfuscator@ javascript-obfuscator/javascript-obfuscator@d444195 d444195 in javascript-obfuscator@beta and webpack-obfuscator@beta
Installation npm i webpack-obfuscator@beta
webpack-obfuscator@beta - special version with javascript-obfuscator@beta dependency.
When [email protected] mailto:[email protected] will be ready, you should install webpack-obfuscator@latest
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub #8 (comment) , or mute the thread https://github.com/notifications/unsubscribe-auth/ABDCAxijhoa194YstD4EdOl79tXnhtndks5q-KaOgaJpZM4Kvnum . https://github.com/notifications/beacon/ABDCA-jARFm9LedzW0F37mGfnezRdxcAks5q-KaOgaJpZM4Kvnum.gif
from webpack-obfuscator.
0.8.0 is ready
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.