Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add r/webpack page #5196

Draft
wants to merge 14 commits into
base: main
Choose a base branch
from
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;
}