Skip to content

Commit

Permalink
build: build name
Browse files Browse the repository at this point in the history
  • Loading branch information
iamkun committed May 15, 2018
1 parent 8baf291 commit a09c52d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions build/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,17 @@ async function build(option) {
locales.forEach((l) => {
build(configFactory({
input: `./src/locale/${l}`,
fileName: `./locale/${l}`
fileName: `./locale/${l}`,
name: `dayjs-locale-${l}`
}))
})

const plugins = await promisifyReadDir(path.join(__dirname, '../src/plugin'))
plugins.forEach((l) => {
build(configFactory({
input: `./src/plugin/${l}`,
fileName: `./plugin/${l}`
fileName: `./plugin/${l}`,
name: `dayjs-plugin-${l}`
}))
})

Expand Down
4 changes: 2 additions & 2 deletions build/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const babel = require('rollup-plugin-babel')
const uglify = require('rollup-plugin-uglify')

module.exports = (config) => {
const { input, fileName } = config
const { input, fileName, name } = config
return {
input: {
input,
Expand All @@ -19,7 +19,7 @@ module.exports = (config) => {
output: {
file: fileName,
format: 'umd',
name: 'dayjs',
name: name || 'dayjs',
globals: {
dayjs: 'dayjs'
}
Expand Down

0 comments on commit a09c52d

Please sign in to comment.