From f43cb47c4e0dc17f620f049ebce2785dd5d7a32e Mon Sep 17 00:00:00 2001 From: Ainvoner <2538825+ainvoner@users.noreply.github.com> Date: Thu, 6 Jul 2023 16:23:00 +0300 Subject: [PATCH] fix(docs): examples file loader (#3294) *By submitting this pull request, I confirm that my contribution is made under the terms of the [Monada Contribution License](https://www.winglang.io/terms-and-policies/contribution-license.html)*. --- docs/docs/src/components/CodeComparison.jsx | 1 - .../function-upload-to-bucket/platforms.js | 22 +++++++++---------- .../function-upload-to-bucket/wing.js | 3 +-- 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/docs/docs/src/components/CodeComparison.jsx b/docs/docs/src/components/CodeComparison.jsx index 7df783b1da8..682d8784c12 100644 --- a/docs/docs/src/components/CodeComparison.jsx +++ b/docs/docs/src/components/CodeComparison.jsx @@ -3,7 +3,6 @@ import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import FileCodeBlock from './FileCodeBlock'; -import helloWPath from '!file-loader!../examples/function-upload-to-bucket/wing/hello.w'; import getExamplePlatforms from '../examples/getExamplePlatforms'; import getExampleWingFile from '../examples/getExampleWingFile'; diff --git a/docs/docs/src/examples/function-upload-to-bucket/platforms.js b/docs/docs/src/examples/function-upload-to-bucket/platforms.js index b1da724917f..101cb395eae 100644 --- a/docs/docs/src/examples/function-upload-to-bucket/platforms.js +++ b/docs/docs/src/examples/function-upload-to-bucket/platforms.js @@ -2,21 +2,21 @@ // Also js files are js.txt files until we find a way to make Docusaurus not minify them -import pulumiIndexPath from '!file-loader!./pulumi/index.js.txt'; -import pulumiMainPath from '!file-loader!./pulumi/main.ts'; -import pulumiPulumiPath from '!file-loader!./pulumi/pulumi.yaml'; +import pulumiIndexPath from '!file-loader?outputPath=docs!./pulumi/index.js.txt'; +import pulumiMainPath from '!file-loader?outputPath=docs!./pulumi/main.ts'; +import pulumiPulumiPath from '!file-loader?outputPath=docs!./pulumi/pulumi.yaml'; -import terraformIndexPath from '!file-loader!./terraform/index.js.txt'; -import terraformMainPath from '!file-loader!./terraform/main.tf'; +import terraformIndexPath from '!file-loader?outputPath=docs!./terraform/index.js.txt'; +import terraformMainPath from '!file-loader?outputPath=docs!./terraform/main.tf'; -import cdkHelloPath from '!file-loader!./aws-cdk/hello.js.txt'; -import cdkIndexPath from '!file-loader!./aws-cdk/index.js.txt'; +import cdkHelloPath from '!file-loader?outputPath=docs!./aws-cdk/hello.js.txt'; +import cdkIndexPath from '!file-loader?outputPath=docs!./aws-cdk/index.js.txt'; -import cdktfIndexPath from '!file-loader!./cdktf/index.js.txt'; -import cdktfMainPath from '!file-loader!./cdktf/main.ts'; +import cdktfIndexPath from '!file-loader?outputPath=docs!./cdktf/index.js.txt'; +import cdktfMainPath from '!file-loader?outputPath=docs!./cdktf/main.ts'; -import cloudformationIndexPath from '!file-loader!./cloudformation/index.js.txt'; -import cloudformationTemplatePath from '!file-loader!./cloudformation/template.yaml'; +import cloudformationIndexPath from '!file-loader?outputPath=docs!./cloudformation/index.js.txt'; +import cloudformationTemplatePath from '!file-loader?outputPath=docs!./cloudformation/template.yaml'; const allPlatforms = [ { diff --git a/docs/docs/src/examples/function-upload-to-bucket/wing.js b/docs/docs/src/examples/function-upload-to-bucket/wing.js index d0eee29c3d5..2cd4b224add 100644 --- a/docs/docs/src/examples/function-upload-to-bucket/wing.js +++ b/docs/docs/src/examples/function-upload-to-bucket/wing.js @@ -1,5 +1,4 @@ // We cannot parse the folder structure at runtime because of Docusaurus and webpack limitations -import wingHelloPath from '!file-loader!./wing/hello.w'; - +import wingHelloPath from '!file-loader?outputPath=docs!./wing/hello.w'; export default { name: "hello.js", path: wingHelloPath };