using linux path configuration
[ 'babel-plugin-root-import', { rootPathSuffix : "./node/", rootPathPrefix : '@/', }, ],
The two file locations are as follows:
F:\work\code\在水医方\zk-server\node\__test__\simple-text-diff-test.jsF:\work\code\在水医方\zk-server\node\config\testImport.js
Run in windows environment
code:
be commented out:
import testimport2 from '@/config/testimport';console.log('testimport2:', testimport2);
[simple-text-diff-test.js:23] Current directory: F:\work\code\在水医方\zk-server\node\__test__[simple-text-diff-test.js:33] Error resolving "@/config/testimport": Error: Cannot find module './node/config/testimport'[simple-text-diff-test.js:37] Resolved path using path.resolve for "@/config/testimport": F:\work\code\在水医方\zk-server\node\__test__\@\config\testimport
as follows:
using linux path configuration
[ 'babel-plugin-root-import', { rootPathSuffix : "./node/", rootPathPrefix : '@/', }, ],
The two file locations are as follows:
F:\work\code\在水医方\zk-server\node\__test__\simple-text-diff-test.js
F:\work\code\在水医方\zk-server\node\config\testImport.js
Run in windows environment
code:
be commented out:
import testimport2 from '@/config/testimport';
console.log('testimport2:', testimport2);
[simple-text-diff-test.js:23] Current directory: F:\work\code\在水医方\zk-server\node\__test__
[simple-text-diff-test.js:33] Error resolving "@/config/testimport": Error: Cannot find module './node/config/testimport'
[simple-text-diff-test.js:37] Resolved path using path.resolve for "@/config/testimport": F:\work\code\在水医方\zk-server\node\__test__\@\config\testimport