Skip to content

Commit

Permalink
Update Rollup to its latest version
Browse files Browse the repository at this point in the history
  • Loading branch information
Avaq committed Nov 24, 2023
1 parent 8f1b160 commit 57ae74c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
"remark-cli": "^12.0.0",
"remark-validate-links": "^13.0.0",
"rimraf": "^5.0.0",
"rollup": "^3.2.5",
"rollup": "^4.5.2",
"sanctuary-benchmark": "^1.0.0",
"sanctuary-either": "^2.0.0",
"sanctuary-type-classes": "^13.0.0",
Expand Down
17 changes: 8 additions & 9 deletions rollup.config.dist.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
/* global process require Set */
/* global process Set */

import {readFileSync} from 'fs';
import node from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';

var pkg = require('./package.json');
var pkg = JSON.parse(readFileSync('package.json', 'utf8'));

var dependencies = pkg => {
var deps = Object.keys(pkg.dependencies || {}).concat(Object.keys(pkg.peerDependencies || {}));
return Array.from(new Set(deps.concat(deps.flatMap(dependency => (
dependencies(require(`${dependency}/package.json`))
dependencies(JSON.parse(readFileSync(`node_modules/${dependency}/package.json`, 'utf8')))
)))));
};

Expand All @@ -24,8 +24,7 @@ ${readFileSync('./LICENSE')}*/
${dependencies(pkg).map(dependency => `/** ${dependency} license
${readFileSync(`./node_modules/${dependency}/LICENSE`)}*/`
).join('\n\n')}`;
${readFileSync(`./node_modules/${dependency}/LICENSE`)}*/`).join('\n\n')}`;

var typeref = `/// <reference types="https://cdn.jsdelivr.net/gh/fluture-js/Fluture@${
process.env.VERSION || pkg.version
Expand All @@ -39,15 +38,15 @@ export default [{
footer: footer,
format: 'iife',
name: 'Fluture',
file: 'dist/bundle.js'
}
file: 'dist/bundle.js',
},
}, {
input: 'index.js',
plugins: [node(), commonjs({include: 'node_modules/**'})],
output: {
banner: `${banner}\n${typeref}\n`,
footer: footer,
format: 'es',
file: 'dist/module.js'
}
file: 'dist/module.js',
},
}];
6 changes: 3 additions & 3 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var dependencies = {
'sanctuary-show': 'sanctuaryShow',
'sanctuary-type-identifiers': 'sanctuaryTypeIdentifiers'
'sanctuary-type-identifiers': 'sanctuaryTypeIdentifiers',
};

export default {
Expand All @@ -10,6 +10,6 @@ export default {
format: 'umd',
file: 'index.cjs',
name: 'Fluture',
globals: dependencies
}
globals: dependencies,
},
};

0 comments on commit 57ae74c

Please sign in to comment.