diff --git a/CHANGELOG-2.x.md b/CHANGELOG-2.x.md index fd554c9bb0..e31f86bf3b 100644 --- a/CHANGELOG-2.x.md +++ b/CHANGELOG-2.x.md @@ -8,6 +8,9 @@ - Fix `swizzle` command not being able to swizzle single js file. - Fix logo URL in footer to be appended with baseUrl automatically. - Add the option `--no-open` for `start` command. +- Set `@babel/env` useBuiltins to `usage`. This will automatically use browserlist and import polyfills required. +- Modified TerserWebpackPlugin `terserOptions` for better cross-browser compatibility. +- **BREAKING** `withBaseUrl` is renamed to `useBaseUrl` because its a React Hooks. Make sure you import/rename it correctly. Eg: `import useBaseUrl from '@docusaurus/useBaseUrl`; - Fix potential security vulnerability because we're exposing the directory structure of the host machine. ## 2.0.0-alpha.27 diff --git a/packages/docusaurus-init/templates/classic/src/pages/index.js b/packages/docusaurus-init/templates/classic/src/pages/index.js index 955aff747d..2200e35c61 100644 --- a/packages/docusaurus-init/templates/classic/src/pages/index.js +++ b/packages/docusaurus-init/templates/classic/src/pages/index.js @@ -10,7 +10,7 @@ import classnames from 'classnames'; import Layout from '@theme/Layout'; import Link from '@docusaurus/Link'; import useDocusaurusContext from '@docusaurus/useDocusaurusContext'; -import withBaseUrl from '@docusaurus/withBaseUrl'; +import useBaseUrl from '@docusaurus/useBaseUrl'; import styles from './styles.module.css'; const features = [ @@ -46,6 +46,21 @@ const features = [ }, ]; +function Feature({imageUrl, title, description}) { + const imgUrl = useBaseUrl(imageUrl); + return ( +
{description}
+{description}
-
@@ -139,7 +139,7 @@ function Home() {
@@ -152,7 +152,7 @@ function Home() {
@@ -168,7 +168,7 @@ function Home() {
@@ -181,7 +181,7 @@ function Home() {