2021年1月22日星期五

How to remove trailing slashes in gatsby project?

i'm facing trailing slash issue in my gatsby project. when i'm trying to reload or trigger an url Ex:website.com/page1, just for second it is loading url with trailing slash like website.com/page1/ and then it is going back to website.com/page1. its happening to every page . I have tried remove trailing slashes plugin but didn't get the result

I will be grateful for any help. Thank you.

  exports.createPages = ({ actions, graphql }) => {    const { createPage } = actions;       const getAboutUs = createPage({      path: `/aboutUs`,     component: path.resolve(`src/templates/AboutUs.jsx`)     });       const getLocateUs = createPage({     path: `/locate-us`,      component: path.resolve(`src/templates/locateUs.jsx`)     });       const getFQAs = createPage({      path: `/faq`,      component: path.resolve(`src/templates/FAQs.jsx`)      });       return Promise.all([      getAboutUs,      getLocateUs,      getFQAs,    ]);   };  exports.onCreateWebpackConfig = ({ actions }) => {    actions.setWebpackConfig({      module: {        rules: [         {               test: require.resolve(`jquery`),        use: [          {            loader: `expose-loader`,            options: `jQuery`          },          {            loader: `expose-loader`,            options: `$`          }        ]      }    ]  },  plugins: [    new webpack.ProvidePlugin({      $: `jquery`,      jQuery: `jquery`      })    ]    });  };  
https://stackoverflow.com/questions/65826047/how-to-remove-trailing-slashes-in-gatsby-project January 21, 2021 at 07:04PM

没有评论:

发表评论