Skip to content

Commit

Permalink
Rollup config
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdcolin committed Feb 28, 2024
1 parent 2914ae6 commit 69233b3
Show file tree
Hide file tree
Showing 5 changed files with 548 additions and 61 deletions.
10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"clean": "rimraf dist",
"start": "node esbuild.mjs",
"prebuild": "npm run clean",
"build": "rollup --config --bundleConfigAsCjs",
"build": "rollup -c rollup.config.js",
"lint": "eslint --report-unused-disable-directives --max-warnings 0 --ext .js,.ts,.jsx,.tsx src/",
"prepack": "npm run build",
"postversion": "git push --follow-tags"
Expand All @@ -36,8 +36,12 @@
"name": "MsaView"
},
"dependencies": {
"@rollup/plugin-typescript": "^11.1.6",
"pako": "^2.1.0",
"react-msaview": "^3.0.3"
"react-msaview": "^3.0.3",
"rollup-plugin-external-globals": "^0.9.2",
"rollup-plugin-polyfill-node": "^0.13.0",
"rollup-plugin-terser": "^7.0.2"
},
"devDependencies": {
"@babel/core": "^7.23.0",
Expand All @@ -56,7 +60,6 @@
"@types/react": "^18.2.28",
"@typescript-eslint/eslint-plugin": "^7.0.1",
"@typescript-eslint/parser": "^7.0.1",
"chalk": "^5.3.0",
"esbuild": "^0.20.0",
"eslint": "^8.51.0",
"eslint-config-prettier": "^9.1.0",
Expand All @@ -74,6 +77,7 @@
"rimraf": "^5.0.5",
"rollup": "^4.9.5",
"rxjs": "^7.8.1",
"ts-node": "^10.9.2",
"tss-react": "^4.9.2",
"typescript": "^5.2.2"
},
Expand Down
33 changes: 7 additions & 26 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,8 @@
import globals from '@jbrowse/core/ReExports/list'
import { createRollupConfig } from '@jbrowse/development-tools'

function stringToBoolean(string) {
if (string === undefined) {
return undefined
}
if (string === 'true') {
return true
}
if (string === 'false') {
return false
}
throw new Error('unknown boolean string')
}

const includeUMD = stringToBoolean(process.env.JB_UMD)
const includeCJS = stringToBoolean(process.env.JB_CJS)
const includeESMBundle = stringToBoolean(process.env.JB_ESM_BUNDLE)
const includeNPM = stringToBoolean(process.env.JB_NPM)

export default createRollupConfig(globals.default, {
includeUMD,
includeCJS,
includeESMBundle,
includeNPM,
require('ts-node').register({
compilerOptions: {
module: 'CommonJS',
},
// and other tsconfig.json options as you like
})

module.exports = require('./rollup.config.ts')
Loading

0 comments on commit 69233b3

Please sign in to comment.