mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-20 12:37:01 +02:00
misc: make copyUntypedFiles work for watch mode (#7445)
This commit is contained in:
parent
5c3d3cfef1
commit
6b53d4263d
51 changed files with 71 additions and 187 deletions
|
@ -1,4 +1,3 @@
|
|||
copyUntypedFiles.mjs
|
||||
.tsbuildinfo*
|
||||
tsconfig*
|
||||
__tests__
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
/**
|
||||
* 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.
|
||||
*/
|
||||
|
||||
import fs from 'fs-extra';
|
||||
import {fileURLToPath} from 'url';
|
||||
|
||||
/**
|
||||
* Copy all untyped and static assets files to lib.
|
||||
*/
|
||||
const srcDir = fileURLToPath(new URL('src', import.meta.url));
|
||||
const libDir = fileURLToPath(new URL('lib', import.meta.url));
|
||||
await fs.copy(srcDir, libDir, {
|
||||
filter(filepath) {
|
||||
return !/__tests__/.test(filepath) && !/\.tsx?$/.test(filepath);
|
||||
},
|
||||
});
|
|
@ -5,8 +5,10 @@
|
|||
"main": "lib/index.js",
|
||||
"types": "src/plugin-debug.d.ts",
|
||||
"scripts": {
|
||||
"build": "tsc --build && node copyUntypedFiles.mjs && prettier --config ../../.prettierrc --write \"lib/theme/**/*.js\"",
|
||||
"watch": "node copyUntypedFiles.mjs && tsc --watch"
|
||||
"build": "tsc --build && node ../../admin/scripts/copyUntypedFiles.mjs && prettier --config ../../.prettierrc --write \"lib/theme/**/*.js\"",
|
||||
"watch": "run-p -c copy:watch build:watch",
|
||||
"build:watch": "tsc --build --watch",
|
||||
"copy:watch": "node ../../admin/scripts/copyUntypedFiles.mjs --watch"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue