Skip to content

Commit d54de6c

Browse files
authored
Merge pull request #366 from marp-team/remove-node-schema
Add `@rollup/plugin-alias` to remove `node:` schema from `require` statements
2 parents 89ff4b4 + 0f21d0f commit d54de6c

File tree

5 files changed

+17
-13
lines changed

5 files changed

+17
-13
lines changed

CHANGELOG.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,10 @@
22

33
## [Unreleased]
44

5-
### Breaking
6-
7-
- Now required Node.js 12.20 and later ([#365](https://github.com/marp-team/marp-cli/pull/365))
8-
95
### Added
106

117
- Installation guide for Homebrew ([#353](https://github.com/marp-team/marp-cli/pull/353))
12-
- Mention Node.js >= 12.20 requirement in README ([#359](https://github.com/marp-team/marp-cli/issues/359), [#361](https://github.com/marp-team/marp-cli/pull/361) by [@jlevon](https://github.com/jlevon), [#365](https://github.com/marp-team/marp-cli/pull/365))
8+
- Mention Node.js >= 12 requirement in README ([#359](https://github.com/marp-team/marp-cli/issues/359), [#361](https://github.com/marp-team/marp-cli/pull/361) by [@jlevon](https://github.com/jlevon))
139

1410
### Changed
1511

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ It can convert Marp / Marpit Markdown files into static HTML / CSS, PDF, PowerPo
2121

2222
[npx (`npm exec`)](https://docs.npmjs.com/cli/v7/commands/npx) is the best way to use the latest Marp CLI if you wanted
2323
one-shot Markdown conversion _without install_. Just run below if you have
24-
installed [Node.js](https://nodejs.org/) 12.20 and later.
24+
installed [Node.js](https://nodejs.org/) 12 and later.
2525

2626
```bash
2727
# Convert slide deck into HTML
@@ -79,7 +79,7 @@ We recommend to install Marp CLI into your Node project. You may control the CLI
7979
npm install --save-dev @marp-team/marp-cli
8080
```
8181

82-
Node.js 12.20 and later is required to install Marp CLI. The installed `marp` command is available in [npm-scripts](https://docs.npmjs.com/misc/scripts) or `npx marp`.
82+
Node.js 12 and later is required to install Marp CLI. The installed `marp` command is available in [npm-scripts](https://docs.npmjs.com/misc/scripts) or `npx marp`.
8383

8484
#### Global installation
8585

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"url": "https://github.com/marp-team/marp-cli"
2727
},
2828
"engines": {
29-
"node": ">=12.20"
29+
"node": ">=12"
3030
},
3131
"main": "lib/index.js",
3232
"types": "types/src/index.d.ts",
@@ -64,6 +64,7 @@
6464
},
6565
"devDependencies": {
6666
"@babel/preset-env": "^7.14.8",
67+
"@rollup/plugin-alias": "^3.1.4",
6768
"@rollup/plugin-commonjs": "^19.0.1",
6869
"@rollup/plugin-json": "^4.1.0",
6970
"@rollup/plugin-node-resolve": "^13.0.2",

rollup.config.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import path from 'path'
2+
import alias from '@rollup/plugin-alias'
23
import commonjs from '@rollup/plugin-commonjs'
34
import json from '@rollup/plugin-json'
45
import nodeResolve from '@rollup/plugin-node-resolve'
@@ -32,6 +33,9 @@ const plugins = (opts = {}) => [
3233
}),
3334
commonjs(),
3435
typescript({ noEmitOnError: false }),
36+
alias({
37+
entries: [{ find: /^node:(.+)$/, replacement: '$1' }],
38+
}),
3539
postcss({
3640
inject: false,
3741
plugins: [
@@ -65,11 +69,7 @@ const browser = (opts = {}) => ({
6569
})
6670

6771
const cli = {
68-
external: external([
69-
...builtinModules,
70-
...builtinModules.map((m) => `node:${m}`),
71-
...Object.keys(dependencies),
72-
]),
72+
external: external([...builtinModules, ...Object.keys(dependencies)]),
7373
plugins: plugins(),
7474
}
7575

yarn.lock

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1198,6 +1198,13 @@
11981198
"@nodelib/fs.scandir" "2.1.5"
11991199
fastq "^1.6.0"
12001200

1201+
"@rollup/plugin-alias@^3.1.4":
1202+
version "3.1.4"
1203+
resolved "https://registry.yarnpkg.com/@rollup/plugin-alias/-/plugin-alias-3.1.4.tgz#47774f4ff0eab5937f7acb392cf2b89921f03b7d"
1204+
integrity sha512-9YN5h0bWlYFV0zpXwwAWGPUWh/A+kkoCqwrMb43LnuGfhnQqOjsGR+5uh4LGpAZbBBj8qR1Hno6CZadZs7hyCQ==
1205+
dependencies:
1206+
slash "^3.0.0"
1207+
12011208
"@rollup/plugin-commonjs@^19.0.1":
12021209
version "19.0.1"
12031210
resolved "https://registry.yarnpkg.com/@rollup/plugin-commonjs/-/plugin-commonjs-19.0.1.tgz#94a2c103d675523d3ab1c60bfbec567b3eb70410"

0 commit comments

Comments
 (0)