Giter Site home page Giter Site logo

Comments (4)

diversario avatar diversario commented on June 12, 2024 1

Published v4.0.0. Give it a try!

from node-ssdp.

olsn avatar olsn commented on June 12, 2024

I just adjusted the webpack config - not to say that this is convenient, but it's more convenient that building some dependencies inside of node_modules:

Add the following to the plugins of your webpack config

new webpack.NormalModuleReplacementPlugin(/\.\/lib-cov\/.*/, resource => {
    resource.request = resource.request.replace("-cov", "");
})

Caution: If you have other modules that contain ./lib-cov/ as part of their path, it will break those - in such a case I guess you'll need to add a separate entry for each of those 3 files.

Btw.: I'm using webpack4, so I'm not 100% sure if it's exactly the same with webpack2 or 1, but there should be similar alternatives. (see: https://webpack.js.org/plugins/normal-module-replacement-plugin/)

from node-ssdp.

diversario avatar diversario commented on June 12, 2024

@jsinai I've not used webpack but do you think this would make it deal with it better:

module.exports = {
  Server: require(process.env.SSDP_COV ? "./lib-cov/server" : "./lib/server"),
  Client: require(process.env.SSDP_COV ? "./lib-cov/client" : "./lib/client"),
  Base: require(process.env.SSDP_COV ? "./lib-cov/index" : "./lib/index")
}

since it sounds like the issue is with using require?

Or, I can do this check in the tests themselves so it would be complete out of the main module. Actually. that's what I'll do, it's cleaner.

from node-ssdp.

jsinai avatar jsinai commented on June 12, 2024

Sorry for the very late response, but your fix worked.

from node-ssdp.

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.