Skip to content
Draft
5 changes: 3 additions & 2 deletions src/components/Site/clientSideRedirections.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ export default function (location) {

if (location.pathname === '/webpack-options/') {
Copy link
Member

@alexander-akait alexander-akait Jul 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe /webpack/options/ so in future we will add /webpack-dev-server/options/ and maybe more

Copy link
Member Author

@chenxsan chenxsan Jul 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about https://webpack.js.org/webpack/?option=output/filename https://webpack.js.org/webpack-dev-server/?option=xxx? It's more terse.

Or https://webpack.js.org/r/webpack/?option=output/filename which is more future proof in case we will be using /webpack/ path on this site in future.

const searchParams = new URLSearchParams(location.search);
console.log(searchParams.get('option'));
return `${searchParams.get('option')}${location.hash}`;
const option = searchParams.get('option');
const options = option.split('/').filter(Boolean);
return `/configuration/${options[0]}/#${options.join('').toLowerCase()}`;
}
return false;
}