jshanson7 / babel-plugin-resolver Goto Github PK
View Code? Open in Web Editor NEWResolve modules from any directory.
Resolve modules from any directory.
Upgraded to 0.0.7 and I'm getting:
TypeError: Path must be a string. Received undefined
at assertPath (path.js:8:11)
at posix.resolve (path.js:426:5)
at Plugin.ResolverPlugin.manipulateOptions (/Users/swillard/Documents/github/cardbuilder-js/node_modules/babel-plugin-resolver/lib/ResolverPlugin.js:14:27)
at File.buildPlugins (/usr/local/lib/node_modules/babel-cli/node_modules/babel-core/lib/transformation/file/index.js:255:16)
at new File (/usr/local/lib/node_modules/babel-cli/node_modules/babel-core/lib/transformation/file/index.js:135:10)
at Pipeline.transform (/usr/local/lib/node_modules/babel-cli/node_modules/babel-core/lib/transformation/pipeline.js:42:16)
at transform (/usr/local/lib/node_modules/babel-cli/lib/babel/util.js:53:22)
at Object.compile (/usr/local/lib/node_modules/babel-cli/lib/babel/util.js:62:12)
at write (/usr/local/lib/node_modules/babel-cli/lib/babel/dir.js:19:21)
at handleFile (/usr/local/lib/node_modules/babel-cli/lib/babel/dir.js:42:7)
My config:
[ "resolver", {
"resolveDirs": ["src", "src/js"]
}],
Things seem fine in 0.0.5
Hi,
are you planning to include support in the plugin to generate relative paths instead of absolute ones? In it's current state it cannot be used to just transpile and distribute code.
After looking at the code I realize that this is the intended behaviour but it would be more useful to generate relative paths. The plugin would keep working as it is now and will work in compile scenarios too :D
I fully realize that this isn't a trivial change. Just asking :)
If you don't have any plans to do so, I'll take a further look at the library to see if I can contribute a solution. I can't promise anything though (-_- U)
This is a very useful project but the last babel versions don't work with it. Do you plan on merging the pull requests or should someone fork it ?
I believe I found a problem when using lodash on Windows 10/Server and Node 4.3.1. Even though Lodash 4.9.0 was properly installed (as referenced on my package.json
, babel-plugin-resolver
was loading was the 3.10.1 version.
I ran into an issue with this plugin where it caused a webpack alias config to change, strangely only for one module. It was trying to resolve it, rather than just using the alias value.
I found another resolver plugin, https://github.com/tleunen/babel-plugin-module-resolver, that does not have this issue, so I've switched to that one.
I don't have a nice small testcase unfortunately, it was in a work project. I tried debugging, but debugging webpack is pretty hairy, though I was able to see that this plugin was the issue.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.