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 @ b96e636d #138

Closed
wants to merge 6 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
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
# rollup changelog

## 4.18.0

_2024-05-22_

### Features

- Resolve import.meta.filename and .dirname in transpiled plugins (#5520)

### Pull Requests

- [#5504](https://github.com/rollup/rollup/pull/5504): Auto generate node index (@lukastaegert)
- [#5507](https://github.com/rollup/rollup/pull/5507): chore(deps): lock file maintenance minor/patch updates (@renovate[bot])
- [#5508](https://github.com/rollup/rollup/pull/5508): chore(deps): lock file maintenance (@renovate[bot])
- [#5510](https://github.com/rollup/rollup/pull/5510): Split up converter.rs into AST nodes (@lukastaegert)
- [#5512](https://github.com/rollup/rollup/pull/5512): chore(deps): update dependency builtin-modules to v4 (@renovate[bot], @lukastaegert)
- [#5514](https://github.com/rollup/rollup/pull/5514): chore(deps): lock file maintenance minor/patch updates (@renovate[bot])
- [#5518](https://github.com/rollup/rollup/pull/5518): chore(deps): update dependency eslint-plugin-unicorn to v53 (@renovate[bot], @lukastaegert)
- [#5519](https://github.com/rollup/rollup/pull/5519): chore(deps): lock file maintenance minor/patch updates (@renovate[bot], @lukastaegert)
- [#5520](https://github.com/rollup/rollup/pull/5520): Resolve import.meta.{filename,dirname} in files imported from config (@BPScott)
- [#5521](https://github.com/rollup/rollup/pull/5521): docs: correct base32 to base36 in documentation (@highcastlee)

## 4.17.2

_2024-04-30_
Expand Down
4 changes: 4 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ After applying this setting, you may need to reset your local branch to ensure t
git reset --hard
```

### Installing dependencies

Running `npm install` will install the necessary dependencies. If it fails, it might be because the Rust toolchain is not yet set up for WebAssembly, see above.

### How to run one test on your local machine

With `npm run test` you can run all tests together.
Expand Down
2 changes: 1 addition & 1 deletion browser/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rollup/browser",
"version": "4.17.2",
"version": "4.18.0",
"description": "Next-generation ES module bundler browser build",
"main": "dist/rollup.browser.js",
"module": "dist/es/rollup.browser.js",
Expand Down
8 changes: 7 additions & 1 deletion cli/run/loadConfigFile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,14 @@ async function loadTranspiledConfigFile(
if (property === 'url') {
return `'${pathToFileURL(moduleId).href}'`;
}
if (property == 'filename') {
return `'${moduleId}'`;
}
if (property == 'dirname') {
return `'${path.dirname(moduleId)}'`;
}
if (property == null) {
return `{url:'${pathToFileURL(moduleId).href}'}`;
return `{url:'${pathToFileURL(moduleId).href}', filename: '${moduleId}', dirname: '${path.dirname(moduleId)}'}`;
}
}
}
Expand Down
8 changes: 8 additions & 0 deletions docs/configuration-options/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -908,11 +908,19 @@ exports.foo = foo;

### output.hashCharacters

<<<<<<< HEAD
| | |
| -----: | :------------------------------ |
| 类型: | `"base64" \| "base32" \| "hex"` |
| CLI: | `--hashCharacters <name>` |
| 默认: | `"base64"` |
=======
| | |
| -------: | :------------------------------ |
| Type: | `"base64" \| "base36" \| "hex"` |
| CLI: | `--hashCharacters <name>` |
| Default: | `"base64"` |
>>>>>>> b96e636d2d8301e2521e07f689782fb24a3e35c5

这个选项决定了 Rollup 在生成文件哈希时可以使用的字符集。

Expand Down
65 changes: 2 additions & 63 deletions package-lock.json

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

5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rollup",
"version": "4.17.2",
"version": "4.18.0",
"description": "Next-generation ES module bundler",
"main": "dist/rollup.js",
"module": "dist/es/rollup.js",
Expand Down Expand Up @@ -81,7 +81,7 @@
"test:all": "concurrently --kill-others-on-fail -c green,blue,magenta,cyan,red 'npm:test:only' 'npm:test:browser' 'npm:test:typescript' 'npm:test:package' 'npm:test:options'",
"test:coverage": "npm run build:cjs && shx rm -rf coverage/* && nyc --reporter html mocha test/test.js",
"test:coverage:browser": "npm run build && shx rm -rf coverage/* && nyc mocha test/browser/index.js",
"test:leak": "node --expose-gc test/leak/index.js",
"test:leak": "npm install --no-save weak-napi && node --expose-gc test/leak/index.js",
"test:package": "node scripts/test-package.js",
"test:options": "node scripts/test-options.js",
"test:only": "mocha test/test.js",
Expand Down Expand Up @@ -194,7 +194,6 @@
"vitepress": "^1.1.4",
"vue": "^3.4.27",
"wasm-pack": "^0.12.1",
"weak-napi": "^2.0.2",
"yargs-parser": "^21.1.1"
},
"overrides": {
Expand Down
2 changes: 1 addition & 1 deletion test/cli/samples/config-import-meta/_config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = defineTest({
description: 'uses correct import.meta.url in config files',
description: 'uses correct import.meta.{url,filename,dirname} in config files',
command: 'rollup -c --bundleConfigAsCjs'
});
2 changes: 2 additions & 0 deletions test/cli/samples/config-import-meta/plugin/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ const fileName = `test.txt`;

function validateImportMeta(importMeta) {
assert.strictEqual(importMeta.url, import.meta.url);
assert.strictEqual(importMeta.filename, import.meta.filename);
assert.strictEqual(importMeta.dirname, import.meta.dirname);
}

validateImportMeta(import.meta);
Expand Down
Loading