No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    robots.txt in root?

    Help
    6
    6
    1616
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • G
      glittle last edited by

      With v0.16, where do I put a robots.txt file so that it gets put into the root of the server?

      1 Reply Last reply Reply Quote 0
      • chad
        chad last edited by

        So far, there isn’t a way to do that. I’m using my Dockerfile to move all of my root assets into the correct place.

        1 Reply Last reply Reply Quote 0
        • B
          bompus last edited by

          This is actually possible. If there is a better way to do this, somebody please let me know.

          I put all of the files/folders in /src/rootFolder/ and this moves all of those during dev/build to the / folder when it builds or runs the dev server.

          quasar.conf.js , require copy-webpack-plugin up top, then add a line to build.extendWebpack

          const CopyWebpackPlugin = require('copy-webpack-plugin');
          /// ...
          extendWebpack(cfg) {
             cfg.plugins.push(new CopyWebpackPlugin([{ from: 'src/rootFolder/', to: '' }]));
            /// ...
          }
          
          N alhidalgodev 2 Replies Last reply Reply Quote 4
          • N
            nargespms @bompus last edited by

            @bompus tnx alot

            1 Reply Last reply Reply Quote 0
            • alhidalgodev
              alhidalgodev @bompus last edited by

              @bompus said in robots.txt in root?:

              This is actually possible. If there is a better way to do this, somebody please let me know.

              I put all of the files/folders in /src/rootFolder/ and this moves all of those during dev/build to the / folder when it builds or runs the dev server.

              quasar.conf.js , require copy-webpack-plugin up top, then add a line to build.extendWebpack

              const CopyWebpackPlugin = require('copy-webpack-plugin');
              /// ...
              extendWebpack(cfg) {
                 cfg.plugins.push(new CopyWebpackPlugin([{ from: 'src/rootFolder/', to: '' }]));
                /// ...
              }
              

              This solved my problem with firebase-messaging-sw.js file. Firebase FCM.

              The official docs from firebase “create an empty file with that name and save it to the root of your domain before recovering a token.”

              1 Reply Last reply Reply Quote 0
              • P
                poprygun last edited by poprygun

                I realize this task by using two files robots-open.txt and robot-closed.txt and setting ENV variable.
                Ad then add WebPackPlugin into quasar.config.js as written above:

                extendWebpack(cfg) {
                      const robotsMode =
                        process.env.OPEN_FOR_ROBOTS === 'true' ? 'opened' : 'closed'
                      console.log(`==> Robots.txt are ${robotsMode}`)
                      cfg.plugins.push(
                        new CopyWebpackPlugin({
                          patterns: [
                            {
                              from: `robots/robots-${robotsMode}.txt`,
                              to: 'robots.txt',
                            },
                          ],
                        }),
                      )
                    },
                
                1 Reply Last reply Reply Quote 0
                • First post
                  Last post