problem
When using vant
to write small programs, install the official way to install references:
// index.json
{
"usingComponents": {
"van-button": "/miniprogram_npm/vant-weapp/button/index",
}
}
but failed
jsEnginScriptError
Component is not found in path "miniprogram_npm/vant-weapp/button/index"
the reason
After searching, it is found that because project.config.json
of the configuration in the project configuration,
{
"miniprogramRoot": "app/",
}
Speculate the reason, because the applet is regarded /app
as the main directory, and the things outside the directory do not belong to the runtime, so it fails when looking for miniprogram_npm outside this directory.