Я получаю следующий результат, когда транспилирую файл javascript с помощью Babel 7.
Я не понимаю присутствия функции cov_5hsavp2s2()
. Кажется, это какие-то метаданные.
Есть ли способ (флаг или конфигурация) предотвратить их создание, поскольку это не имеет ничего общего с функциональностью модуля.
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _useMuiTheme = _interopRequireDefault(require("./useRepl"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function cov_5hsavp2s2() {
var path = "/home/me/use-repl/src/index.js";
var hash = "8995b4e9d98ed443cd65fa7d3cf9e2594de820db";
var global = new Function("return this")();
var gcv = "__coverage__";
var coverageData = {
path: "/home/me/use-repl/src/index.js",
statementMap: {},
fnMap: {},
branchMap: {},
s: {},
f: {},
b: {},
_coverageSchema: "1a1c01bbd47fc00a2c39e90264f33305004495a9",
hash: "8995b4e9d98ed443cd65fa7d3cf9e2594de820db"
};
var coverage = global[gcv] || (global[gcv] = {});
if (!coverage[path] || coverage[path].hash !== hash) {
coverage[path] = coverageData;
}
var actualCoverage = coverage[path];
{
// @ts-ignore
cov_5hsavp2s2 = function () {
return actualCoverage;
};
}
return actualCoverage;
}
cov_5hsavp2s2();
var _default = _useMuiRepl.default;
exports.default = _default;
Пакет. json
{
"name": "@devskope/use-repl",
"version": "1.0.0",
"main": "./lib/index.js",
"files": [
"/lib"
],
"scripts": {
"build": "babel --delete-dir-on-start --copy-files src --out-dir lib ",
"test": "nyc mocha"
},
"babel": {
"presets": [
[
"@babel/preset-env",
{
"targets": {
"node": "current"
}
}
],
"@babel/preset-react"
],
"plugins": [
"istanbul"
]
},
"nyc": {
"require": [
"@babel/register"
]
},
"engines": {
"node": ">=.10.0.0"
},
"author": "devskope",
"repository": {
"type": "git",
"url": "git+https://github.com/devskope/use-mui-theme.git"
},
"bugs": {
"url": "https://github.com/devskope/use-mui-theme/issues"
},
"homepage": "https://github.com/devskope/use-mui-theme#readme",
"license": "MIT",
"keywords": [
"hook",
"hooks",
"material-ui",
"material ui",
"mui",
"react",
"theme"
],
"peerDependencies": {
"@material-ui/core": "^4.4.0",
"react": "^16.8.0",
"react-dom": "^16.8.0"
},
"devDependencies": {
"@babel/cli": "^7.10.1",
"@babel/core": "^7.10.1",
"@babel/preset-env": "^7.10.1",
"@babel/preset-react": "^7.10.1",
"@babel/register": "^7.10.1",
"babel-plugin-istanbul": "^6.0.0",
"chai": "^4.2.0",
"dotenv": "^8.2.0",
"enzyme": "^3.11.0",
"enzyme-adapter-react-16": "^1.15.2",
"jsdom": "^16.2.2",
"mocha": "^7.2.0",
"nodemon": "^2.0.4",
"nyc": "^15.0.1",
"prop-types": "^15.7.2"
},
"dependencies": {
"@material-ui/core": "^4.4.0"
}
}