mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-31 01:47:17 +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);
|
||||
},
|
|
@ -8,7 +8,7 @@
|
|||
"build": "yarn build:server && yarn build:browser && yarn build:copy && yarn build:format",
|
||||
"build:server": "tsc --project tsconfig.server.json",
|
||||
"build:browser": "tsc --project tsconfig.browser.json",
|
||||
"build:copy": "node copyUntypedFiles.js",
|
||||
"build:copy": "node copyUntypedFiles.mjs",
|
||||
"build:format": "prettier --config ../../.prettierrc --write \"lib/**/*.js\""
|
||||
},
|
||||
"publishConfig": {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue