diff --git a/gatsby-node.js b/gatsby-node.js index 48173b2e19..c85c067680 100644 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -375,8 +375,9 @@ exports.onPostBuild = async () => { (()=>{ const jsFiles = glob.sync(`${publicPath}/*.js`); - + const mapFiles = glob.sync(`${publicPath}/*.map`); const replaceNames = {}; + for (let file of jsFiles) { const filename = path.basename(file); const fileNameWithoutExt = filename.split('.')[0]; @@ -392,6 +393,25 @@ exports.onPostBuild = async () => { fs.renameSync(file, path.join(path.dirname(file), finalFileName)); } } + + for (let file of mapFiles) { + const filename = path.basename(file); + const fileNameWithoutExt = filename.split('.')[0]; + const originHash = fileNameWithoutExt.split('-').at(-1); + + if (originHash && originHash!==fileNameWithoutExt) { + let fileNameWithoutExtWithHash = fileNameWithoutExt.replace(originHash, `${originHash}${numHash}`); + replaceNames[originHash] = `${originHash}${numHash}`; + fs.renameSync(file, path.join(path.dirname(file), `${fileNameWithoutExtWithHash}.js.map`)); + } else { + let finalFileName = `${fileNameWithoutExt}${numHash}.js.map`; + replaceNames[filename] = finalFileName; + fs.renameSync(file, path.join(path.dirname(file), finalFileName)); + } + } + + + const allFiles = glob.sync(`${publicPath}/**/*.{js,html,json}`); for (let file of allFiles) { const stats = fs.statSync(file); diff --git a/packages/semi-ui/pincode/_story/pincode.stories.js b/packages/semi-ui/pincode/_story/pincode.stories.js index c958b78304..52bdf3472f 100644 --- a/packages/semi-ui/pincode/_story/pincode.stories.js +++ b/packages/semi-ui/pincode/_story/pincode.stories.js @@ -1,34 +1,52 @@ -import React,{useState} from 'react'; +import React, { useState, useRef } from 'react'; import PinCode from '../index'; export default { - title: 'PinCode' -} + title: 'PinCode', +}; export const PinCodeBasic = () => ( <> - alert(v)} onChange={v=>{ - console.log(v) - }}/> - alert(v)} onChange={v=>{ - console.log(v) - }}/> - alert(v)} onChange={v=>{ - console.log(v) - }}/> + alert(v)} + onChange={v => { + console.log(v); + }} + /> + alert(v)} + onChange={v => { + console.log(v); + }} + /> + alert(v)} + onChange={v => { + console.log(v); + }} + /> ); export const PinCodeControl = () => { - const [value,setValue] = useState("123"); + const [value, setValue] = useState('123'); const ref = useRef(); - return <> - - console.log("pincode: ",value)} - value={value} onChange={v=>{ - console.log(v) - setValue(v) - }}/> - -} + return ( + <> + + console.log('pincode: ', value)} + value={value} + onChange={v => { + console.log(v); + setValue(v); + }} + /> + + ); +}; diff --git a/src/components/layout.js b/src/components/layout.js index e6743e6997..13eb8257f0 100644 --- a/src/components/layout.js +++ b/src/components/layout.js @@ -189,7 +189,7 @@ const AppLayout = ({ type, location, children }) => { { - !isIde && (
+ !isIde && (
{locale === "zh-CN" ? '跳转到:' : 'skip to:'}