Skip to content

Commit

Permalink
chore: make js a commonjs by default
Browse files Browse the repository at this point in the history
  • Loading branch information
P0lip committed May 13, 2021
1 parent 4d9e229 commit f1280d8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ module.exports = [
{
input: path.resolve(BASE_PATH, 'src/index.ts'),
output: {
entryFileNames: '[name].cjs',
entryFileNames: '[name].js',
dir: path.resolve(BASE_PATH, 'dist'),
format: 'cjs',
},
Expand Down
5 changes: 3 additions & 2 deletions src/commands/bundle/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,11 @@ export default class BundleCommand extends BuildCommand {
protected preparePackageJson() {
const pkg = super.preparePackageJson();
Object.assign(pkg, {
main: './index.cjs',
type: "commonjs",
main: './index.js',
module: './index.mjs',
exports: {
require: './index.cjs',
require: './index.js',
import: './index.mjs',
},
});
Expand Down

0 comments on commit f1280d8

Please sign in to comment.