Skip to content
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

docs(en): merge rollup/master into rollup-docs-cn/master @ 63a91a66 #113

Closed
wants to merge 8 commits into from
Closed
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: 3 additions & 3 deletions .github/workflows/repl-artefacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,14 @@ jobs:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- name: Find Comment
uses: peter-evans/find-comment@v2
uses: peter-evans/find-comment@v3
id: findComment
with:
issue-number: ${{ github.event.number }}
comment-author: 'github-actions[bot]'
body-includes: 'Thank you for your contribution!'
- name: Create or update comment
uses: peter-evans/create-or-update-comment@v3
uses: peter-evans/create-or-update-comment@v4
id: createInitialComment
with:
comment-id: ${{ steps.findComment.outputs.comment-id }}
Expand All @@ -124,7 +124,7 @@ jobs:
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Update comment with Vercel preview URL
uses: peter-evans/create-or-update-comment@v3
uses: peter-evans/create-or-update-comment@v4
if: ${{ steps.waitForVercel.outputs.url }}
with:
comment-id: ${{ steps.createInitialComment.outputs.comment-id }}
Expand Down
6 changes: 5 additions & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
<<<<<<< HEAD
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx zhlint docs/**/*.md --fix
if [ \"$SKIP_BUILD\" != \"true\" ]; then npm run build:docs; fi
git add -A
git add -A
=======
npx lint-staged
>>>>>>> 63a91a663a33ba06025c6838e5bbeb794df93af7
2 changes: 1 addition & 1 deletion cli/run/watch-cli.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { FSWatcher } from 'node:fs';
import { readFile } from 'node:fs/promises';
import process from 'node:process';
import type { FSWatcher } from 'chokidar';
import chokidar from 'chokidar';
import dateTime from 'date-time';
import ms from 'pretty-ms';
Expand Down
8 changes: 7 additions & 1 deletion docs/configuration-options/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,15 +109,21 @@ export default {
如果你想将一组文件转换为另一种格式,并同时保持文件结构和导出签名,推荐的方法是将每个文件变成一个入口文件,而不是使用 [`output.preserveModules`](#output-preservemodules),后者可能会导出被除屑优化,并产生由插件创建的虚拟文件。你可以动态地处理,例如通过 `glob` 包。

```js
import glob from 'glob';
import { globSync } from 'glob';
import path from 'node:path';
import { fileURLToPath } from 'node:url';

export default {
input: Object.fromEntries(
<<<<<<< HEAD
glob.sync('src/**/*.js').map(file => [
// 这里将删除 `src/` 以及每个文件的扩展名。
// 因此,例如 src/nested/foo.js 会变成 nested/foo
=======
globSync('src/**/*.js').map(file => [
// This remove `src/` as well as the file extension from each
// file, so e.g. src/nested/foo.js becomes nested/foo
>>>>>>> 63a91a663a33ba06025c6838e5bbeb794df93af7
path.relative(
'src',
file.slice(0, file.length - path.extname(file).length)
Expand Down
14 changes: 10 additions & 4 deletions docs/tools/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -254,19 +254,25 @@ gulp.task('build', async function () {
如果你想要在 Deno 中使用 Rollup,你可以通过 [esm.sh](https://esm.sh/) 这样做:

```js
import {rollup} from "https://esm.sh/[email protected]";
import { rollup } from "https://esm.sh/@rollup/browser";

const bundle = await rollup({ //...
```

<<<<<<< HEAD
或者你可以从 npm 安装 rollup 并使用 [node 兼容层](https://deno.land/[email protected]/node):
=======
But it is not suitable for complex compiling. Alternatively you can install rollup from npm:
>>>>>>> 63a91a663a33ba06025c6838e5bbeb794df93af7

```js
import {createRequire} from "https://deno.land/[email protected]/node/module.ts";
const require = createRequire(import.meta.url);
const {rollup} = require("rollup");
import { rollup } from "npm:rollup";

const bundle = await rollup({ //...
```

<<<<<<< HEAD
请确保使用 `--unstable` 标志运行 deno。如果你计划使用 `bundle.write()`,请不要忘记 `--allow-read` 和 `--allow-write`。
=======
Notice: Deno will request some permissions when running Rollup.
>>>>>>> 63a91a663a33ba06025c6838e5bbeb794df93af7
Loading
Loading