Skip to content

Commit

Permalink
Merge pull request #156 from rollup/sync-5d91210d
Browse files Browse the repository at this point in the history
docs(en): merge rollup/master into rollup-docs-cn/master @ 5d91210
  • Loading branch information
waynzh authored Oct 8, 2024
2 parents 569bdef + 41a2f8a commit 72ce23b
Show file tree
Hide file tree
Showing 354 changed files with 5,128 additions and 1,425 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# rollup changelog

## 4.24.0

_2024-10-02_

### Features

- Support preserving and transpiling JSX syntax (#5668)

### Pull Requests

- [#5668](https://github.com/rollup/rollup/pull/5668): Introduce JSX support (@lukastaegert, @Martin-Idel, @felixhuttmann, @AlexDroll, @tiptr)

## 4.23.0

_2024-10-01_
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.23.0",
"version": "4.24.0",
"description": "Next-generation ES module bundler browser build",
"main": "dist/rollup.browser.js",
"module": "dist/es/rollup.browser.js",
Expand Down
4 changes: 4 additions & 0 deletions browser/src/path.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,7 @@ export function resolve(...paths: string[]): string {

return resolvedParts.join('/');
}

// Used for running the browser build locally in Vite
export const win32 = {};
export const posix = {};
3 changes: 2 additions & 1 deletion browser/src/wasm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import { parse } from '../../wasm/bindings_wasm.js';
export async function parseAsync(
code: string,
allowReturnOutsideFunction: boolean,
jsx: boolean,
_signal?: AbortSignal | undefined | null
) {
return parse(code, allowReturnOutsideFunction);
return parse(code, allowReturnOutsideFunction, jsx);
}
4 changes: 4 additions & 0 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import replaceBrowserModules from '../../build-plugins/replace-browser-modules';
import '../declarations.d';
import { examplesPlugin } from './create-examples';
import { renderMermaidGraphsPlugin } from './mermaid';
import { replacePathPicomatch } from './replace-path-picomatch';
import { transposeTables } from './transpose-tables';
import { buildEnd, callback, transformPageData } from './verify-anchors';

Expand Down Expand Up @@ -157,7 +158,10 @@ export default defineConfig({
title: 'Rollup 中文文档',
transformPageData,
vite: {
optimizeDeps: { exclude: ['@rollup/pluginutils'] },
plugins: [
replacePathPicomatch(),
replaceBrowserModules(),
renderMermaidGraphsPlugin(),
replaceBrowserModules(),
{
Expand Down
22 changes: 22 additions & 0 deletions docs/.vitepress/replace-path-picomatch.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import path from 'path';
import type { Plugin } from 'vite';

export function replacePathPicomatch(): Plugin {
return {
enforce: 'pre',
load(id) {
if (id === 'picomatch') {
return 'export default {}';
}
},
name: 'replace-picomatch',
resolveId(source) {
if (source === 'picomatch') {
return { id: 'picomatch' };
}
if (source === 'path') {
return path.resolve(__dirname, '../../browser/src/path.ts');
}
}
};
}
Loading

0 comments on commit 72ce23b

Please sign in to comment.