Git Product home page Git Product logo

Comments (5)

emn178 avatar emn178 commented on May 31, 2024

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.

emn178 avatar emn178 commented on May 31, 2024

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.

daddybh avatar daddybh commented on May 31, 2024

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.

emn178 avatar emn178 commented on May 31, 2024

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.

joshxyzhimself avatar joshxyzhimself commented on May 31, 2024

Different syntax for ignorePlugin in webpack 5?

https://webpack.js.org/plugins/ignore-plugin/

from js-md5.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.