Skip to content

Commit

Permalink
chore(rollup): update rollup impl
Browse files Browse the repository at this point in the history
  • Loading branch information
zeon256 committed May 25, 2024
1 parent 3065aee commit 62aabc3
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 16 deletions.
3 changes: 1 addition & 2 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@
"description": "Markdown Table to Minified JSON Transpiler CLI tool",
"type": "module",
"scripts": {
"cleanBuild": "rm -rf ../../dist/cli && tsc && chmod +x ../../dist/cli/main.js",
"build": "rollup -c"
},
"dependencies": {
"commander": "^11.0.0"
},
"author": "Budi Syahiddin",
"license": "MIT"
}
}
9 changes: 4 additions & 5 deletions packages/cli/rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// packages/cli/rollup.config.js
import typescript from '@rollup/plugin-typescript';
import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
Expand All @@ -7,16 +6,16 @@ import terser from '@rollup/plugin-terser';
export default {
input: 'src/mdt2json.ts',
output: {
file: '../../dist/cli/mdt2json.js', // Adjust the output path to match your cleanBuild script
file: '../../dist/cli/mdt2json.js',
format: 'cjs',
banner: '#!/usr/bin/env node',
sourcemap: true
sourcemap: false
},
plugins: [
resolve({
modulePaths: ['../lib/src']
modulePaths: ['../../dist/lib/']
}),
commonjs(),
commonjs({browser: false}),
typescript({ tsconfig: './tsconfig.json' }),
terser()
],
Expand Down
5 changes: 1 addition & 4 deletions packages/cli/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@
"removeComments": true,
"typeRoots": ["./src", "../../node_modules/@types", "../../dist/lib/"]
},

"references": [
{ "path": "../lib" }
],
"references": [{ "path": "../lib" }],
"exclude": ["tsconfig.json", "tsconfig-build.json", "tests"],
"ts-node": {
"esm": true
Expand Down
7 changes: 3 additions & 4 deletions packages/lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@
"description": "Markdown Table to Minified JSON Transpiler",
"private": true,
"files": [
"dist",
"src",
"tests"
],
"dist": {
"type": "module",
"main": "./dist/lib.js",
"module": "./dist/lib.js",
"types": "./dist/lib.d.ts"
"main": "../../dist/lib/mdt2json.js",
"module": "../../dist/lib/mdt2json.mjs",
"types": "../../dist/lib/mdt2json.d.ts"
},
"types": "./dist/lib.d.ts",
"type": "module",
Expand Down
1 change: 0 additions & 1 deletion packages/lib/rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// packages/lib/rollup.config.js
import typescript from "@rollup/plugin-typescript";
import resolve from "@rollup/plugin-node-resolve";
import commonjs from "@rollup/plugin-commonjs";
Expand Down

0 comments on commit 62aabc3

Please sign in to comment.