Hi,
I want to set alias for production builds with webpack, and simply change the path from like:
import someComponent from 'MyLibrary/src/components/some-component'
to
import someComponent from 'MyLibrary/dist/some-component'
and I also set these import as externals in webpack
so when my library user use my modules , theire webpack actually resolve these modules, it would go to the dist dir and resolve these modules correctly.
But the problem was, I got these warnings:
Could not resolve "MyLibrary/dist/some-component" in file /Users/me/WorkSpace/MyLibrary/src/components/some-component/xx.js.
I got the correct result from the babel ouputs:
var _someComponent = _interopRequireDefault(require("MyLibrary/dist/some-component"));
Even though, MyLibrary/dist/** is not actually a real folder in my cwd, but it will eventually maps to the package I publish on npm.
In summary, it there a way to just simply transform those requires but not actually trigger the resolution warnning ?
I'm also getting tons of Could not resolve warnings even though everything works.
Most helpful comment
I'm also getting tons of
Could not resolvewarnings even though everything works.