Business background
use wepy
to develop Mini Program
for the first time, you need to use md5 > encrypt data and then request remote data
install js-md5
through npm
, but cannot reference this package through require
in the project.
directory structure
site directory
...
node_modules
dist
...
npm
...
src
...
pages
public
...
js
api.js
app.wpy
related codes
npm
npm install js-md5 --save
api.js
const md5 = require("js-md5")
error content
after wepy build-- watch
is executed on the terminal, Mini Program"s development tool reports the following error when compiling
thirdScriptError
sdk uncaught third Error
module "npm/js-md5/src/md5.js" is not defined
Error: module "npm/js-md5/src/md5.js" is not defined
try
- you can manually put the package downloaded by npm into the
dist/npm
directory .
- or use the relative path to navigate to
js-md5.js
this file can also be
question
how do I make wepy
automatically compile dependent packages under the dist/npm
directory?
take a look at wepy.cnfig.js
where it doesn"t seem to be set