mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-09 23:27:28 +02:00
misc: convert all internal scripts to ESM (#6286)
* misc: convert all internal scripts to ESM * fixes * fix * fixes * fix! * complete eslint * more move * fix! * This looks better? * Final ones
This commit is contained in:
parent
bcc05e243f
commit
4fad1ce0cd
66 changed files with 412 additions and 374 deletions
|
@ -1,4 +1,4 @@
|
|||
copyUntypedFiles.js
|
||||
copyUntypedFiles.mjs
|
||||
.tsbuildinfo
|
||||
tsconfig*
|
||||
__tests__
|
||||
|
|
|
@ -5,15 +5,15 @@
|
|||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
const path = require('path');
|
||||
const fs = require('fs-extra');
|
||||
import fs from 'fs-extra';
|
||||
import {fileURLToPath} from 'url';
|
||||
|
||||
/**
|
||||
* 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, {
|
||||
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,8 @@
|
|||
"main": "lib/index.js",
|
||||
"types": "src/plugin-debug.d.ts",
|
||||
"scripts": {
|
||||
"build": "tsc && node copyUntypedFiles.js",
|
||||
"watch": "node copyUntypedFiles.js && tsc --watch"
|
||||
"build": "tsc && node copyUntypedFiles.mjs",
|
||||
"watch": "node copyUntypedFiles.mjs && tsc --watch"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue