This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"main": "dist/cjs/index.js", | |
"module": "dist/mjs/index.js", | |
"exports": { | |
".": { | |
"import": "./dist/mjs/index.js", | |
"require": "./dist/cjs/index.js" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat >dist/cjs/package.json <<!EOF | |
{ | |
"type": "commonjs" | |
} | |
!EOF | |
cat >dist/mjs/package.json <<!EOF | |
{ | |
"type": "module" | |
} | |
!EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"compilerOptions": { | |
"allowJs": true, | |
"allowSyntheticDefaultImports": true, | |
"baseUrl": "src", | |
"declaration": true, | |
"esModuleInterop": true, | |
"inlineSourceMap": false, | |
"lib": ["esnext"], | |
"listEmittedFiles": false, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"extends": "./tsconfig-base.json", | |
"compilerOptions": { | |
"module": "commonjs", | |
"outDir": "dist/cjs", | |
"target": "es2015" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"extends": "./tsconfig-base.json", | |
"compilerOptions": { | |
"module": "esnext", | |
"outDir": "dist/mjs", | |
"target": "esnext" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"scripts": { | |
"build": "rm -fr dist/* && tsc -p tsconfig.json && tsc -p tsconfig-cjs.json && ./fixup" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Shape from './Shape.js' | |
const shape = new Shape.default() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Shape from './Shape.js' | |
export class MyShape { | |
constructor() { | |
this.shape = new Shape() | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"main": "dist/cjs/index.js", | |
"module": "dist/mjs/index.js" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"exports": { | |
"import": { | |
"path": "./dist/mjs/index.js", | |
"type": "module" | |
}, | |
"require": { | |
"path": "./dist/cjs/index.js", | |
"type": "commonjs" | |
} |
NewerOlder