Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5335b33

Browse files
committed
change readme
1 parentccf9b48 commit5335b33

File tree

1 file changed

+14
-20
lines changed

1 file changed

+14
-20
lines changed

‎readme.md‎

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,10 @@
5454
"scripts": {
5555
"dev":"next",
5656
"build":"next build",
57-
"start":"next start",
58-
"export":"NODE_ENV=production npm run build && next export -o docs && touch docs/.nojekyll"
57+
"start":"next start"
5958
}
6059
}
6160
```
62-
(theexport script isfor github pages)
6361

6462
### [Typescript](https://github.com/zeit/next.js#typescript)
6563

@@ -347,23 +345,7 @@
347345
assetPrefix: isProd? prodAssetPrefix:'';,
348346
});
349347
```
350-
2. change`as` propin`next/Link` to add`linkPrefix`
351-
```tsx
352-
import React from'react';
353-
import Link from'next/link';
354-
import { join } from'path';
355-
356-
const linkPrefix = process.env.LINK_PREFIX;
357-
358-
const PrefixedLink: React.FC<PrefixedLinkProps> = ({
359-
href,
360-
as = href,
361-
linkPrefix = LINK_PREFIX,
362-
...props
363-
}) =><Link href={href} as={join(linkPrefix,as.toString())} {...props} />;
364-
365-
export default PrefixedLink;
366-
```
348+
2. change`as` propin`next/Link` to add`linkPrefix`, similar to`src/features/link/Link.tsx`in the example setup
367349
3. change`scripts`in`package.json`
368350
```json
369351
{
@@ -381,6 +363,18 @@
381363
```sh
382364
npm i -D @babel/plugin-proposal-nullish-coalescing-operator @babel/plugin-proposal-optional-chaining
383365
```
366+
2. add the plugins to`babel.config.js`
367+
```js
368+
module.exports = {
369+
presets: [
370+
// ...
371+
],
372+
plugins: [
373+
'@babel/plugin-proposal-optional-chaining',
374+
'@babel/plugin-proposal-nullish-coalescing-operator',
375+
],
376+
};
377+
```
384378
385379
### Dotenv
386380
1.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp