Skip to content

Add @rollup/plugin-alias to remove node: schema from require statements #366

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 22, 2021
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
6 changes: 1 addition & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,10 @@

## [Unreleased]

### Breaking

- Now required Node.js 12.20 and later ([#365](https://github.com/marp-team/marp-cli/pull/365))

### Added

- Installation guide for Homebrew ([#353](https://github.com/marp-team/marp-cli/pull/353))
- 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))
- 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))

### Changed

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ It can convert Marp / Marpit Markdown files into static HTML / CSS, PDF, PowerPo

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

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

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`.
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`.

#### Global installation

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"url": "https://github.com/marp-team/marp-cli"
},
"engines": {
"node": ">=12.20"
"node": ">=12"
},
"main": "lib/index.js",
"types": "types/src/index.d.ts",
Expand Down Expand Up @@ -64,6 +64,7 @@
},
"devDependencies": {
"@babel/preset-env": "^7.14.8",
"@rollup/plugin-alias": "^3.1.4",
"@rollup/plugin-commonjs": "^19.0.1",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "^13.0.2",
Expand Down
10 changes: 5 additions & 5 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import path from 'path'
import alias from '@rollup/plugin-alias'
import commonjs from '@rollup/plugin-commonjs'
import json from '@rollup/plugin-json'
import nodeResolve from '@rollup/plugin-node-resolve'
Expand Down Expand Up @@ -32,6 +33,9 @@ const plugins = (opts = {}) => [
}),
commonjs(),
typescript({ noEmitOnError: false }),
alias({
entries: [{ find: /^node:(.+)$/, replacement: '$1' }],
}),
postcss({
inject: false,
plugins: [
Expand Down Expand Up @@ -65,11 +69,7 @@ const browser = (opts = {}) => ({
})

const cli = {
external: external([
...builtinModules,
...builtinModules.map((m) => `node:${m}`),
...Object.keys(dependencies),
]),
external: external([...builtinModules, ...Object.keys(dependencies)]),
plugins: plugins(),
}

Expand Down
7 changes: 7 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1198,6 +1198,13 @@
"@nodelib/fs.scandir" "2.1.5"
fastq "^1.6.0"

"@rollup/plugin-alias@^3.1.4":
version "3.1.4"
resolved "https://registry.yarnpkg.com/@rollup/plugin-alias/-/plugin-alias-3.1.4.tgz#47774f4ff0eab5937f7acb392cf2b89921f03b7d"
integrity sha512-9YN5h0bWlYFV0zpXwwAWGPUWh/A+kkoCqwrMb43LnuGfhnQqOjsGR+5uh4LGpAZbBBj8qR1Hno6CZadZs7hyCQ==
dependencies:
slash "^3.0.0"

"@rollup/plugin-commonjs@^19.0.1":
version "19.0.1"
resolved "https://registry.yarnpkg.com/@rollup/plugin-commonjs/-/plugin-commonjs-19.0.1.tgz#94a2c103d675523d3ab1c60bfbec567b3eb70410"
Expand Down