Skip to content

Commit

Permalink
feat: add esm support
Browse files Browse the repository at this point in the history
  • Loading branch information
jwr1 committed May 11, 2022
1 parent 29fbb44 commit c87d3bc
Show file tree
Hide file tree
Showing 7 changed files with 10,317 additions and 1,342 deletions.
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,6 @@ The example shown above is used as the default values, you only need to specify

## `StrfDate` Reference

### Codes

A flag lets you modify the output of a code used in your format. Here are the default flags used for both `StrfDate` and `ExpressDate`:

| Code | Description |
| ------- | ------------------------------------------------------------------- |
| `%%` | a literal % |
Expand Down
17 changes: 17 additions & 0 deletions build.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import {execSync} from 'child_process';
import {rmSync, mkdirSync, renameSync, copyFileSync, rmdirSync} from 'fs';

rmSync('dist', {force: true, recursive: true});
mkdirSync('dist');

mkdirSync('dist/ts');
execSync('tsc --module CommonJS');
renameSync('dist/ts/index.js', 'dist/index.js');
execSync('tsc --module ESNext');
renameSync('dist/ts/index.js', 'dist/index.mjs');
renameSync('dist/ts/index.d.ts', 'dist/index.d.ts');
rmdirSync('dist/ts');

for (const file of ['package.json', 'README.md', 'LICENSE']) {
copyFileSync(file, 'dist/' + file);
}
Loading

0 comments on commit c87d3bc

Please sign in to comment.