Git Product home page Git Product logo

Comments (8)

callmecavs avatar callmecavs commented on May 20, 2024

@PascalAOMS no index.js is required, neither are src files. the downloaded files should be as they are (ES5), otherwise your build process would have to transpile your node_modules, which is undesirable and unmaintainable, because of the likelihood of library authors using different babel configs.

all the fields in the package.json that tell bundlers where to get the file from point to the dist folder. those dist files are created in the prepublish hook.

npm and yarn are only used to install packages - its likely a problem with your bundler config (browserify, webpack, etc) thats causing the failure to import. without seeing more of your config, its hard to say for sure, but im almost 100% positive this is related to that

from jump.js.

PascalAOMS avatar PascalAOMS commented on May 20, 2024

Thank you very much for the explanation.

from jump.js.

callmecavs avatar callmecavs commented on May 20, 2024

@PascalAOMS no problem. feel free to post your webpack/browserify config - id be happy to take a look

from jump.js.

PascalAOMS avatar PascalAOMS commented on May 20, 2024

You can find my webpack.config.js here.

Thanks!

from jump.js.

callmecavs avatar callmecavs commented on May 20, 2024

@PascalAOMS my guess is that something with your directory structure is throwing off webpack and preventing it from finding your node_modules.

the way you're aliasing vue looks like its because of a similar problem you had importing it. try adding a root to your resolve object, as in the following, and hopefully you wont need aliases (unless those are there for a different reason):

resolve: {
  // point this to the root folder of your project
  // node_modules should be inside of the folder this points to
  root:  path.resolve(__dirname, './relative/path'),
  
  alias: {
    // your existing aliases might not be needed anymore
    // if jump.js works, try removing the vue alias
  }
}

let me know if that helps

from jump.js.

PascalAOMS avatar PascalAOMS commented on May 20, 2024

I am using Webpack 2. You gave me a good tip with root though.

The equivalent would be

resolve: {
        modules: ['src', 'node_modules']
}

But that does not seem to work either.

from jump.js.

callmecavs avatar callmecavs commented on May 20, 2024

@PascalAOMS im stumped. this is my boilerplate for webpack 2, itll generate a directory for you. using that structure, everything works for me without even specifying the root directory or modules directory 🤕

here's a link to the webpack config (its in the template folder)

from jump.js.

PascalAOMS avatar PascalAOMS commented on May 20, 2024

Using const jump = require('jump.js').default works as well.

No idea why though. Yea...

from jump.js.

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.