Skip to content

Commit

Permalink
enable import of interval-bins binEvenLengthRound in package vcf-geno…
Browse files Browse the repository at this point in the history
…type-brapi

 ... as binEvenLengthRound was undefined in production container build.
package.json : move rollup configuration from prepare script to rollup.config.js. update version -> 1.0.2
added rollup.config.js, based on copy from child-process-progressive/
drop webpack.config.js as it has been replaced by rollup.config.js
  • Loading branch information
Don-Isdale committed Aug 16, 2024
1 parent e6c05b2 commit 8852b74
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 28 deletions.
16 changes: 10 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,29 @@
{
"name": "interval-bins",
"version": "1.0.1",
"version": "1.0.2",
"repository": {
"type": "git",
"url": "git+https://github.com/plantinformatics/interval-bins.git"
},
"description": "binEvenLengthRound() : Calculate the bin size for even-sized bins to span the given interval. binBoundaries() : Generate an array of even-sized bins to span the given interval.",
"main": "src/index.js",
"type": "module",
"main": "main.js",
"browser": "dist/interval-bins.js",
"exports": {
"import": "./dist/interval-bins.js",
"require": "./src/index.js"
".": {
"import": "./dist/interval-bins.mjs",
"require": "./dist/interval-bins.cjs"
},
"./dist/interval-bins.mjs": "./dist/interval-bins.mjs",
"./dist/interval-bins.cjs": "./dist/interval-bins.cjs"
},
"files": [
"dist",
"src"
],
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"prepare": "rm -rf build && mkdir build && rollup -f umd -n interval-bins -o dist/interval-bins.js -- main.js",
"build": "webpack"
"prepare": "rm -rf dist && mkdir dist && rollup -c"
},
"keywords": [
"javascript",
Expand Down
26 changes: 26 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import json from '@rollup/plugin-json';

export default {
input: 'main.js', // Entry point for the application
output: [
{
file: 'dist/interval-bins.mjs', // Output bundle location
format: 'esm'
},
{
file: 'dist/interval-bins.cjs', // Output bundle location
format: 'cjs' // CommonJS format suitable for Node.js require()
}
],
plugins: [
resolve({
preferBuiltins: true // Prefer Node.js built-ins over npm modules if available
}),
commonjs(),
json()
],
// List of Node built-in modules to leave as external dependencies
// external: []
};
22 changes: 0 additions & 22 deletions webpack.config.js

This file was deleted.

0 comments on commit 8852b74

Please sign in to comment.