Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/multi-entry/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ _Note: `default` exports cannot be combined and exported by this plugin. Only na

## Requirements

This plugin requires an [LTS](https://github.com/nodejs/Release) Node version (v8.3.0+) and Rollup v1.20.0+.
This plugin requires an [LTS](https://github.com/nodejs/Release) Node version (v14.0.0+) and Rollup v1.20.0+.

## Install

Expand Down
26 changes: 17 additions & 9 deletions packages/multi-entry/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,15 @@
"author": "rollup",
"homepage": "https://github.com/rollup/plugins/tree/master/packages/multi-entry/#readme",
"bugs": "https://github.com/rollup/plugins/issues",
"main": "dist/index.js",
"module": "dist/index.es.js",
"main": "./dist/cjs/index.js",
"module": "./dist/es/index.js",
"exports": {
"types": "./types/index.d.ts",
"import": "./dist/es/index.js",
"default": "./dist/cjs/index.js"
},
"engines": {
"node": ">=10.0.0"
"node": ">=14.0.0"
},
"scripts": {
"build": "rollup -c",
Expand All @@ -33,6 +38,7 @@
},
"files": [
"dist",
"!dist/**/*.map",
"types",
"README.md",
"LICENSE"
Expand All @@ -46,20 +52,22 @@
"entries"
],
"peerDependencies": {
"rollup": "^1.20.0 || ^2.0.0"
"rollup": "^1.20.0||^2.0.0||^3.0.0"
},
"peerDependenciesMeta": {
"rollup": {
"optional": true
}
},
"dependencies": {
"@rollup/plugin-virtual": "^2.0.3",
"matched": "^5.0.0"
"matched": "^5.0.1"
},
"devDependencies": {
"rollup": "^2.67.3"
"rollup": "^3.0.0-7"
},
"types": "./types/index.d.ts",
"ava": {
"babel": {
"compileEnhancements": false
},
"files": [
"!**/fixtures/**",
"!**/helpers/**",
Expand Down
10 changes: 0 additions & 10 deletions packages/multi-entry/rollup.config.js

This file was deleted.

11 changes: 11 additions & 0 deletions packages/multi-entry/rollup.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { readFileSync } from 'fs';

import { createConfig } from '../../shared/rollup.config.mjs';

export default {
...createConfig({
pkg: JSON.parse(readFileSync(new URL('./package.json', import.meta.url), 'utf8'))
}),
input: 'src/index.js',
plugins: []
};
1 change: 1 addition & 0 deletions packages/multi-entry/test/node_modules/current-package

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

Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
/* eslint-disable no-bitwise */

import { createRequire } from 'module';

import test from 'ava';
import { rollup } from 'rollup';

import { getCode } from '../../../util/test';
import multiEntry from 'current-package';

import multiEntry from '../';
import { getCode } from '../../../util/test.js';

test('takes a single file as input', async (t) => {
const bundle = await rollup({ input: 'test/fixtures/0.js', plugins: [multiEntry()] });
Expand Down Expand Up @@ -81,3 +83,11 @@ test('makes a bundle with entryFileName as the filename', async (t) => {
const [result] = await getCode(bundle, { format: 'cjs' }, true);
t.is(result.fileName, 'testing.js');
});

test('works as CJS plugin', async (t) => {
const require = createRequire(import.meta.url);
const multiEntryPluginCjs = require('current-package');
const bundle = await rollup({ input: 'test/fixtures/0.js', plugins: [multiEntryPluginCjs()] });
const code = await getCode(bundle);
t.truthy(code.includes('exports.zero = zero;'));
});
13 changes: 6 additions & 7 deletions pnpm-lock.yaml

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