Skip to content

Commit 4f28b2f

Browse files
authored
fix(dynamic-import-vars): prepare for Rollup 3 (#1297)
BREAKING CHANGES: Requires Node 14
1 parent e4686fd commit 4f28b2f

12 files changed

+127
-312
lines changed

packages/dynamic-import-vars/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ function importLocale(locale) {
1919

2020
## Requirements
2121

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

2424
## Install
2525

packages/dynamic-import-vars/package.json

+23-15
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,15 @@
1313
"author": "LarsDenBakker",
1414
"homepage": "https://github.com/rollup/plugins/tree/master/packages/dynamic-import-vars",
1515
"bugs": "https://github.com/rollup/plugins/issues",
16-
"main": "dist/index.js",
17-
"module": "dist/index.es.js",
16+
"main": "./dist/cjs/index.js",
17+
"module": "./dist/es/index.js",
18+
"exports": {
19+
"import": "./dist/es/index.js",
20+
"types": "./types/index.d.ts",
21+
"default": "./dist/cjs/index.js"
22+
},
1823
"engines": {
19-
"node": ">= 10.0.0"
24+
"node": ">=14.0.0"
2025
},
2126
"scripts": {
2227
"build": "rollup -c",
@@ -32,6 +37,7 @@
3237
},
3338
"files": [
3439
"dist",
40+
"!dist/**/*.map",
3541
"types",
3642
"README.md",
3743
"LICENSE"
@@ -48,25 +54,27 @@
4854
"interpolation"
4955
],
5056
"peerDependencies": {
51-
"rollup": "^1.20.0||^2.0.0"
57+
"rollup": "^1.20.0||^2.0.0||^3.0.0"
58+
},
59+
"peerDependenciesMeta": {
60+
"rollup": {
61+
"optional": true
62+
}
5263
},
5364
"dependencies": {
54-
"@rollup/pluginutils": "^4.1.2",
55-
"estree-walker": "^2.0.1",
56-
"fast-glob": "^3.2.7",
57-
"magic-string": "^0.25.7"
65+
"@rollup/pluginutils": "^4.2.1",
66+
"estree-walker": "^2.0.2",
67+
"fast-glob": "^3.2.12",
68+
"magic-string": "^0.26.4"
5869
},
5970
"devDependencies": {
60-
"acorn": "^7.3.1",
61-
"acorn-dynamic-import": "^4.0.0",
62-
"prettier": "^2.0.5",
63-
"rollup": "^2.67.3"
71+
"acorn": "^8.8.0",
72+
"prettier": "^2.7.1",
73+
"rollup": "^3.0.0-7"
6474
},
6575
"types": "./types/index.d.ts",
6676
"ava": {
67-
"babel": {
68-
"compileEnhancements": false
69-
},
77+
"workerThreads": false,
7078
"files": [
7179
"!**/fixtures/**",
7280
"!**/snapshots/**"

packages/dynamic-import-vars/rollup.config.js

-10
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { readFileSync } from 'fs';
2+
3+
import { createConfig } from '../../shared/rollup.config.mjs';
4+
5+
export default {
6+
...createConfig({
7+
pkg: JSON.parse(readFileSync(new URL('./package.json', import.meta.url), 'utf8'))
8+
}),
9+
input: 'src/index.js',
10+
plugins: []
11+
};

packages/dynamic-import-vars/test/node_modules/current-package

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/dynamic-import-vars/test/rollup-plugin-dynamic-import-vars.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const { join } = require('path');
55
const test = require('ava');
66
const { rollup } = require('rollup');
77

8-
const dynamicImportVars = require('../dist/index').default;
8+
const dynamicImportVars = require('current-package');
99

1010
process.chdir(join(__dirname, 'fixtures'));
1111

packages/dynamic-import-vars/test/snapshots/rollup-plugin-dynamic-import-variables.js.md

-181
This file was deleted.

0 commit comments

Comments
 (0)