Skip to content

Commit

Permalink
🛠️ yarn -> npm, babel -> esbuild
Browse files Browse the repository at this point in the history
  • Loading branch information
torifat committed Nov 7, 2021
1 parent 1fba217 commit 5ccf1b0
Show file tree
Hide file tree
Showing 12 changed files with 10,012 additions and 6,576 deletions.
55 changes: 0 additions & 55 deletions .babelrc

This file was deleted.

2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
*.log
.vscode
.env
package-lock.json
yarn.lock
3 changes: 2 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"singleQuote": true,
"trailingComma": "es5"
"trailingComma": "es5",
"arrowParens":"avoid"
}
34 changes: 34 additions & 0 deletions build.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/usr/bin/env node

const process = require('process');

const isCI = require('is-ci');
const fg = require('fast-glob');
const esbuild = require('esbuild');

const isEsmBuild = process.argv[2] !== '--cjs';

const config = {
cjs: {
format: 'cjs',
platform: 'node',
outdir: './lib/cjs',
},
esm: {
outdir: './lib/esm',
},
};

fg('src/**/*.js', {
ignore: ['**/__tests__', '**/__fixtures__'],
})
.then(entryPoints =>
esbuild.build({
entryPoints,
sourcemap: true,
logLevel: isCI ? 'silent' : 'info',
target: 'node12.13',
...(isEsmBuild ? config.esm : config.cjs),
})
)
.catch(err => process.exit(1));
18 changes: 0 additions & 18 deletions index.js

This file was deleted.

12 changes: 12 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module.exports = async () => {
return {
transform: {
'^.+\\.jsx?$': [
'esbuild-jest-transform',
{
target: 'es2015',
},
],
},
};
};
2 changes: 1 addition & 1 deletion media/screenshot.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 5ccf1b0

Please sign in to comment.