robots.txt in root?
-
With v0.16, where do I put a robots.txt file so that it gets put into the root of the server?
-
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.
-
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: '' }])); /// ... }
-
@bompus tnx alot
-
@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.”
-
I realize this task by using two files
robots-open.txt
androbot-closed.txt
and setting ENV variable.
Ad then add WebPackPlugin intoquasar.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', }, ], }), ) },