File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ const config = {
3434 }
3535 } ) ,
3636 rawContentPlugin ( {
37- include : '**.css' ,
37+ include : [ '**.css' , '**.txt' ] ,
3838 } ) ,
3939 typescript ( ) ,
4040 etaPlugin ( {
Original file line number Diff line number Diff line change 1+ User-agent: *
2+ Allow: /
Original file line number Diff line number Diff line change @@ -6,6 +6,8 @@ import renderNotFound from './templates/404.eta'
66import renderError from './templates/error.eta'
77import renderHome from './templates/home.eta'
88
9+ import robotsTxt from './robots.txt'
10+
911export const router = new Router ( {
1012 ignoreTrailingSlash : true ,
1113 defaultRoute ( req ) {
@@ -18,6 +20,12 @@ export const router = new Router({
1820 }
1921} )
2022
23+ router . get ( '/robots.txt' , ( ) => new Response ( robotsTxt , {
24+ headers : {
25+ 'Content-Type' : 'text/plain; charset=utf-8'
26+ }
27+ } ) )
28+
2129router . get ( '/_assets/style.css' , ( ) => new Response ( styleCss , {
2230 headers : {
2331 'Content-Type' : 'text/css; charset=utf-8'
Original file line number Diff line number Diff line change @@ -2,3 +2,8 @@ declare module '*.css' {
22 declare const content : string
33 export default content
44}
5+
6+ declare module '*.txt' {
7+ declare const content : string
8+ export default content
9+ }
You can’t perform that action at this time.
0 commit comments