Comments (5)
hi, js-md5 will use Node.js method in Node.js environment. see
https://github.com/emn178/js-md5/blob/master/src/md5.js#L126-L127
If webpack finds that source code includes require('xxx')
, it will include the dependencies in bundle file.
Sorry, but I can't stop webpack doing this.
If you don't want to include anyway, you can remove the part related to Node.js from source code.
from js-md5.
I found a way to ignore the dependencies. Set up your webpack config by this.
var webpack = require('webpack');
module.exports = {
// ...
plugins: [
new webpack.IgnorePlugin(/^crypto$/),
new webpack.IgnorePlugin(/^buffer$/)
]
};
Remember to remove if other libraries really need these.
from js-md5.
thanks @emn178 , webpack plugins could solve the problem. I guess it's pretty simple to do md5 within nodejs, what do you think make js-md5 a pure front-end lib, :)
from js-md5.
I make it provides the same interface so that you can write an application run in both front-end and back-end with this library.
from js-md5.
Different syntax for ignorePlugin
in webpack 5?
https://webpack.js.org/plugins/ignore-plugin/
from js-md5.
Related Issues (20)
- How can I use it in web worker thread? HOT 2
- How to unpack?? HOT 1
- Error on IE 10 when using non-string messages HOT 3
- Size limit HOT 3
- Array buffer allocation failure HOT 4
- DENO HOT 1
- Wrong result with file size between 2G and 4G HOT 1
- Speed comparison HOT 6
- Supports 32-bit encryption? HOT 1
- Possible Malware HOT 3
- 兼容 HOT 1
- how to use utf-8? HOT 1
- how to add salt when encryption
- how to get hash of a file from remote url HOT 1
- md5.base64是否可以还原? HOT 1
- why md5 is different HOT 6
- Missing base64 method from type definition HOT 1
- React native expo doesnt work after update to 0.8.0. HOT 2
- Docs: Correct benchmark result + joseph-md5
- Different MD5 hash HOT 2
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 js-md5.