question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Doesn't compile a npm linked module

See original GitHub issue

Not sure this is a babel loader issue or a webpack issue.

I am developing two modules and one of them has a dependency on the other. So I have npm linked it. I have the following config on webpack:

loaders: [{
      test: /\.js$/,
      loaders: ['babel'],
      exclude: /node_modules\/(?!other-module)/,
      include: __dirname
}]

This works fine if I install dependency as a local dependency but if I use npm link, babel doesn’t process it.

Am I missing something? Or is there a workaround for this?

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:116
  • Comments:72 (2 by maintainers)

github_iconTop GitHub Comments

79reactions
theninjacommented, Feb 8, 2017

@mingxian For Webpack 2, adding this to seemed to resolve (derp) the issue :

resolve: {
	symlinks: false
}
60reactions
scriptjscommented, Nov 26, 2015

@henit Try putting the presets in your package.json instead with a babel property:

  "babel": {
    "presets": [
      "es2015",
      "react"
    ]
  },
Read more comments on GitHub >

github_iconTop Results From Across the Web

NPM: After "npm link" module is not found - Stack Overflow
The problem was that the main property of package.json was pointing to a non-existing file. It seems that the problem can happen due...
Read more >
Why isn't the npm link command working? | Benjamin W Fox
Running npm link creates a symlink (or 'symbolic link') from your global node_modules folder to the my-package directory (where the command was ...
Read more >
Npm link set up advice and troubleshooting - Code Buckets
Troubleshooting npm link · 1. Check you've linked every package · 2. Don't globally install your local packages · 3. Check you've linked...
Read more >
npm-link
First, npm link in a package folder will create a symlink in the global folder {prefix}/lib/node_modules/<package> that links to the package where the...
Read more >
An alternative to npm-link for relative dependencies
npm link dependency # link-install the package ... if your dependency uses a different node version, npm-link does not work correctly.
Read more >

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found