Skip to content

Commit

Permalink
Merge dcc5003 into 3ff7d04
Browse files Browse the repository at this point in the history
  • Loading branch information
r3wt committed Apr 19, 2021
2 parents 3ff7d04 + dcc5003 commit e8c3854
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ stages:
provider: npm
email: "$NPM_EMAIL"
api_key: "$NPM_TOKEN"
cleanup: true
skip_cleanup: true
cleanup: false
after_success:
- npm run coveralls
19 changes: 14 additions & 5 deletions build.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,28 @@
const { build } = require('esbuild');
const pkg = require('./package.json');

const modulesToBuild = [pkg.module,pkg.main];
const modulesToBuild = [
{
file: pkg.module,
format: 'esm'
},
{
file: pkg.main,
format: 'cjs'
}
];

Promise.all(modulesToBuild.map(moduleName=>build({
Promise.all(modulesToBuild.map(mod=>build({
entryPoints: [pkg.source],
format: 'esm',
outfile: moduleName,
format: mod.format,
outfile: mod.file,
tsconfig: './tsconfig.build.json',
minify: true,
bundle: true,
logLevel: 'info',
sourcemap: true,
external: ['react', 'react-dom']
}).then(()=>console.log('`%s` built successfully',moduleName))))
}).then(()=>console.log('`%s` built successfully',mod.file))))
.then(() => {
console.log('all modules built successfully');
})
Expand Down

0 comments on commit e8c3854

Please sign in to comment.