Skip to content

Commit

Permalink
chore: update build script
Browse files Browse the repository at this point in the history
  • Loading branch information
splashwizard committed Aug 10, 2020
1 parent 4fad49b commit 9613893
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion build/esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ const { ncp } = require('ncp')

const { promisify } = util

const typeFileExt = '.d.ts'
const localeDir = path.join(process.env.PWD, 'esm/locale')
const pluginDir = path.join(process.env.PWD, 'esm/plugin')
const typeFileExt = '.d.ts';
const localeTypePath = path.join(process.env.PWD, 'esm/locale', `index${typeFileExt}`);

(async () => {
try {
const readLocaleDir = await promisify(fs.readdir)(localeDir)
Expand All @@ -20,6 +22,10 @@ const typeFileExt = '.d.ts';

await promisify(ncp)('./types/', './esm')

const readLocaleFile = await promisify(fs.readFile)(localeTypePath, 'utf8')
const localResult = readLocaleFile.replace("'dayjs", "'dayjs/esm")
await promisify(fs.writeFile)(localeTypePath, localResult, 'utf8')

const readPluginDir = await promisify(fs.readdir)(pluginDir)
readPluginDir.forEach(async (p) => {
if (p.includes(typeFileExt)) {
Expand Down

0 comments on commit 9613893

Please sign in to comment.