Skip to content

Commit

Permalink
Feat: Include cjs entry point
Browse files Browse the repository at this point in the history
  • Loading branch information
sandypockets committed Dec 16, 2023
1 parent 703abe4 commit e49a4e4
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 17 deletions.
1 change: 1 addition & 0 deletions dist/index.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "epic-remark",
"version": "0.1.5",
"version": "0.1.6",
"description": "Epic Remark is an all-in-one markdown to HTML processor built on top of remark",
"main": "dist/index.js",
"module": "dist/index.esm.js",
Expand Down
53 changes: 37 additions & 16 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,41 @@ import commonjs from '@rollup/plugin-commonjs';
import postcss from 'rollup-plugin-postcss';
import { terser } from 'rollup-plugin-terser';

export default {
input: 'src/index.js',
output: {
file: 'dist/index.esm.js',
format: 'esm',
sourcemap: false,
export default [
// ESM build
{
input: 'src/index.js',
output: {
file: 'dist/index.esm.js',
format: 'esm',
sourcemap: false,
},
plugins: [
resolve(),
commonjs(),
postcss({
extract: true,
minimize: true,
}),
terser(),
],
},
plugins: [
resolve(),
commonjs(),
postcss({
extract: true,
minimize: true,
}),
terser(),
],
};
// CommonJS build
{
input: 'src/index.js',
output: {
file: 'dist/index.js',
format: 'cjs',
sourcemap: false,
},
plugins: [
resolve(),
commonjs(),
postcss({
extract: true,
minimize: true,
}),
terser(),
],
}
];

0 comments on commit e49a4e4

Please sign in to comment.