refactor(locales, sw): use es module (#11204)
* refactor(locales): use es module
* fix sw build
* fix gulp
* try fixing storybook
* Revert "try fixing storybook"
This reverts commit 5f2a4eee01
.
* try fixing storybook 2
* Update main.ts
* Update build.js
* Update main.ts
* Update changes.ts
* fix sw lint
* Update build.js
This commit is contained in:

committed by
GitHub

parent
5059d4d7e1
commit
59046d583d
@@ -1,6 +1,5 @@
|
||||
import { readFile, writeFile } from 'node:fs/promises';
|
||||
import { resolve } from 'node:path';
|
||||
import * as JSON5 from 'json5';
|
||||
import JSON5 from 'json5';
|
||||
|
||||
const keys = [
|
||||
'_dark',
|
||||
@@ -26,9 +25,9 @@ const keys = [
|
||||
'd-u0',
|
||||
]
|
||||
|
||||
Promise.all(keys.map((key) => readFile(resolve(__dirname, `../src/themes/${key}.json5`), 'utf8'))).then((sources) => {
|
||||
await Promise.all(keys.map((key) => readFile(new URL(`../src/themes/${key}.json5`, import.meta.url), 'utf8'))).then((sources) => {
|
||||
writeFile(
|
||||
resolve(__dirname, './themes.ts'),
|
||||
new URL('./themes.ts', import.meta.url),
|
||||
`export default ${JSON.stringify(
|
||||
Object.fromEntries(sources.map((source, i) => [keys[i], JSON5.parse(source)])),
|
||||
undefined,
|
||||
|
Reference in New Issue
Block a user