-
DescribeThe document describes it like this
inputimport path from 'path'
import Hobber from '@ones/hobber-core'
const appPath = path.resolve(__dirname)
const app = Hobber({ appPath: appPath })
app.then((hobber)=>{ hobber.lift() });
export default {} Configbuild script: "swc-build": "npx swc src -d ./dist --only **/*.ts --config-file .swcrc --env-name='test' --copy-files" {
"minify": false,
"sourceMaps": true,
"module": {
"type": "commonjs",
"strict": false, // key config
"strictMode": true,
"lazy": false,
"noInterop": false,
"ignoreDynamic": false
}
} But, my output looks like this: "use strict";
Object.defineProperty(exports, "a", {
value: !0
}), exports.default = void 0;
var _path = _interopRequireDefault(require("path"));
var _hobberCore = _interopRequireDefault(require("@ones/hobber-core")); // has __esModule build with babel or tsc
function _interopRequireDefault(a) {
return a && a.a ? a : {
default: a
};
}
var appPath = _path.default.resolve(__dirname);
_hobberCore.default({
b: appPath
}).then(function(a) {
a.c();
}), exports.default = {
}; if set strict to true, like this:"use strict";
exports.default = void 0;
var _path = _interopRequireDefault(require("path"));
var _hobberCore = _interopRequireDefault(require("@ones/hobber-core"));
function _interopRequireDefault(a) {
return a && a.a ? a : {
default: a
};
}
var appPath = _path.default.resolve(__dirname);
_hobberCore.default({
b: appPath
}).then(function(a) {
a.c();
}), exports.default = {
}; Why
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 7 replies
-
Because |
Beta Was this translation helpful? Give feedback.
-
How to be compatible with babel ? |
Beta Was this translation helpful? Give feedback.
-
key config: jsc.minify.mangle.property When I delete the property, the result is correct! |
Beta Was this translation helpful? Give feedback.
key config: jsc.minify.mangle.property
When I delete the property, the result is correct!