This repository has been archived by the owner on Sep 11, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: bundle with rollup to output proper JS files
- Loading branch information
Showing
9 changed files
with
122 additions
and
27 deletions.
There are no files selected for viewing
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
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
Empty file.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { rm } from 'node:fs/promises'; | ||
|
||
const tsDir = new URL('../generated/ts/', import.meta.url); | ||
|
||
const options = { force: true, recursive: true }; | ||
|
||
await Promise.all([ | ||
rm(tsDir, options) // | ||
]); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { rm } from 'node:fs/promises'; | ||
|
||
const saelemTsFile = new URL('../generated/ts/saelem.ts', import.meta.url); | ||
|
||
const options = { force: true, recursive: true }; | ||
|
||
await Promise.all([ | ||
rm(saelemTsFile, options) // | ||
]); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import typescript from 'rollup-plugin-typescript2'; | ||
import { fileURLToPath } from 'url'; | ||
|
||
const rootDir = new URL('../', import.meta.url); | ||
const tsDir = new URL('generated/ts/', rootDir); | ||
|
||
const tsconfigFile = new URL('tsconfig.generated.json', rootDir); | ||
const inputFile = new URL('saelem.ts', tsDir); | ||
const cjsOutputFile = new URL('saelem.cjs', tsDir); | ||
const mjsOutputFile = new URL('saelem.mjs', tsDir); | ||
|
||
export default { | ||
input: fileURLToPath(inputFile), | ||
output: [ | ||
{ | ||
file: fileURLToPath(cjsOutputFile), | ||
format: 'cjs', | ||
exports: 'named', | ||
sourcemap: true | ||
}, | ||
{ | ||
file: fileURLToPath(mjsOutputFile), | ||
format: 'es', | ||
exports: 'named', | ||
sourcemap: true | ||
} | ||
], | ||
plugins: [typescript({ tsconfig: fileURLToPath(tsconfigFile) })] | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"extends": "./tsconfig.base.json", | ||
"files": ["generated/ts/saelem.ts"] | ||
} |
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