Skip to content

Commit

Permalink
Add copyUntypedFiles
Browse files Browse the repository at this point in the history
Signed-off-by: Josh-Cena <[email protected]>
  • Loading branch information
Josh-Cena committed Sep 2, 2021
1 parent bd2b924 commit 18e3fc0
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
20 changes: 20 additions & 0 deletions packages/docusaurus-plugin-debug/copyUntypedFiles.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

const path = require('path');
const fs = require('fs-extra');

/**
* Copy all untyped and static assets files to lib.
*/
const srcDir = path.resolve(__dirname, 'src');
const libDir = path.resolve(__dirname, 'lib');
fs.copySync(srcDir, libDir, {
filter(filepath) {
return !/__tests__/.test(filepath) && !/\.tsx?$/.test(filepath);
},
});
5 changes: 3 additions & 2 deletions packages/docusaurus-plugin-debug/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"main": "lib/index.js",
"types": "src/types.d.ts",
"scripts": {
"build": "tsc",
"watch": "tsc --watch"
"build": "tsc && node copyUntypedFiles.js",
"watch": "node copyUntypedFiles.js && tsc --watch"
},
"publishConfig": {
"access": "public"
Expand All @@ -21,6 +21,7 @@
"@docusaurus/core": "2.0.0-beta.5",
"@docusaurus/types": "2.0.0-beta.5",
"@docusaurus/utils": "2.0.0-beta.5",
"fs-extra": "^9.1.0",
"react-json-view": "^1.21.3",
"tslib": "^2.1.0"
},
Expand Down

0 comments on commit 18e3fc0

Please sign in to comment.