Skip to content

Commit

Permalink
更新babel和build命令
Browse files Browse the repository at this point in the history
  • Loading branch information
mayuxian committed Feb 2, 2021
1 parent 67457be commit faeafce
Show file tree
Hide file tree
Showing 30 changed files with 13 additions and 5,855 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@ coverage
# build
/locale
/plugin
/dayjs.min.js
/dist
/esm
/index.d.ts
locale.json

#dev
demo.js
18 changes: 9 additions & 9 deletions build/esm.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
const util = require('util')
const { ncp } = require('ncp')
const { promisify } = util
const { ncp } = require('ncp')

// const path = require('path')
// const typeFileExt = '.d.ts'
// console.log('process.env.PWD', process.env.PWD);
// console.log('process.cwd()', process.cwd()); //cwd()会根据不同的执行目录不同
// console.log('__dirname', __dirname);
// const rootDir = process.env.PWD || path.join(__dirname, '../')
// console.log('rootDir', rootDir);
const path = require('path')
const typeFileExt = '.d.ts'
console.log('process.env.PWD', process.env.PWD);
console.log('process.cwd()', process.cwd()); //cwd()会根据不同的执行目录不同
console.log('__dirname', __dirname);
const rootDir = process.env.PWD || path.join(__dirname, '../')
console.log('rootDir', rootDir);

(async () => {
try {
await promisify(ncp)('./types/', './dist')
await promisify(ncp)(path.join(rootDir, './types/'), './esm')
} catch (e) {
console.error(e) // eslint-disable-line no-console
}
Expand Down
3 changes: 1 addition & 2 deletions build/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const rollup = require('rollup')
const configFactory = require('./rollup.config')
const fs = require('fs')
const util = require('util')
const path = require('path')
const { ncp } = require('ncp')
Expand Down Expand Up @@ -29,7 +28,7 @@ async function build(option) {

build(configFactory({
input: './src/index.js',
fileName: './dist/js-timers.min.js',
fileName: './js-timers.min.js',
}))

await promisify(ncp)('./types/', './')
Expand Down
3 changes: 0 additions & 3 deletions dist/esm/count-down-timer.js

This file was deleted.

Empty file removed dist/esm/http-timer.js
Empty file.
6 changes: 0 additions & 6 deletions dist/esm/index.js

This file was deleted.

102 changes: 0 additions & 102 deletions dist/esm/timer.js

This file was deleted.

127 changes: 0 additions & 127 deletions dist/js-timers.min.js

This file was deleted.

Loading

0 comments on commit faeafce

Please sign in to comment.