swc/crates/swc_ecma_parser/tests/tsc/commonJSReexport.ts

20 lines
322 B
TypeScript

// #41422, based on prettier's exports
// @noEmit: true
// @checkJS: true
// @filename: first.js
const hardline = { type: "hard" }
module.exports = {
hardline
}
// @filename: second.js
module.exports = {
nested: require('./first')
};
// @filename: main.js
const { hardline } = require('./second').nested;
hardline