Create an app project and a widget project, both modern(.mjs)
Build widget project to generate .mjs output
Run npm run build form app project, success
But, when run npm run test, throw errors
Error: Cannot find module 'customWidget/CustomWidget'
at Function.Module._resolveFilename <internal\modules\cjs\loader.js:581:15>
at Function.Module._load <internal\modules\cjs\loader.js:507:25>
at Module.require <internal\modules\cjs\loader.js:637:17>
at require <internal\modules\cjs\helpers.js:22:18>
at <src\widgets\Header.tsx:2:1>
at <src\widgets\Header.tsx:3:17>
at Object.<anonymous> <src\widgets\Header.tsx:9:3>
at Module._compile <internal\modules\cjs\loader.js:689:30>
at Module.m._compile <node_modules\@dojo\cli-test-intern\node_modules\ts-node\src\index.ts:422:23>
at Module._extensions..js <internal\modules\cjs\loader.js:700:10>
The cli-test-intern NOT found the .mjs file, but the file exists.
Then I try build the widget with --legacy, put the .js file to the node_modules/customWidget/,
And run npm run test again, tests all passed.
So I think cli-test-intern may not found .mjs correctly.
Bug
Package Version: v6.0
.mjs
outputnpm run build
form app project, successnpm run test
, throw errorsThe cli-test-intern NOT found the
.mjs
file, but the file exists. Then I try build the widget with--legacy
, put the.js
file to the node_modules/customWidget/, And runnpm run test
again, tests all passed.So I think cli-test-intern may not found
.mjs
correctly.