Open bajtos opened 4 years ago
can I start work on this?
should I remove it entirely from the loopback
repo, or only when internally testing @loopback/build
?
can I start work on this?
Absolutely!
should I remove it entirely from the loopback repo, or only when internally testing @loopback/build?
IIUC, the change would be limited to @loopback/build
.
@itamar244, i just assigned it to you. Thanks.
My idea is to modify lb-mocha
and/or the default .mocharc.js
file to leverage Node.js built-in --enable-source-maps
option instead of depending on a 3rd-party module source-map-support
. As Diana wrote, the change will be limited to @loopback/build
, but since all LB4 code is using @loopback/build
to run the tests, this change will affect other code too.
Here is the place where we are configuring source-map-support
:
We must carefully consider impact on existing consumers of @loopback/build
. I think the safest option is to publish this change as semver-major, see Making breaking changes in our dev docs.
I added the --enable-source-maps
to the mocha file conditionally depending on the Node version, using semver
package and .mocharc.js
file for custom logic instead of .json
file. it seems to work.
I will submit a working PR tommorow 😄
Starting from version 12.12.0, Node.js offers built-in support for translating error stack traces using source maps - learn more here: https://medium.com/@nodejs/source-maps-in-node-js-482872b56116
Let's rework
@loopback/build
to use this new feature on recent version of Node.js, instead ofsource-map-support
module.If it's possible, then implement a fallback to npm module
source-map-support
when running on Node.js 10.x.If that's not possible, then this change must wait until we can drop support for Node.js 10.x, which will happen after 10.x reaches EOL on 2021-04-30 per https://github.com/nodejs/Release.