forked from barbosaalr/vuejs-datepicker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-locale.js
38 lines (35 loc) · 968 Bytes
/
build-locale.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import fs from 'fs'
import path from 'path'
import {terser} from 'rollup-plugin-terser'
import babel from 'rollup-plugin-babel'
import commonjs from 'rollup-plugin-commonjs'
const files = fs.readdirSync('./src/locale/translations')
const config = files.map(file => {
return {
input: path.join(__dirname, '..', 'src', 'locale', 'translations', file),
output: {
file: path.join(__dirname, '..', 'dist', 'locale', 'translations', file),
format: 'umd',
name: `vdp_translation_${file}`
},
plugins: [
commonjs(),
babel({exclude: 'node_modules/**'}),
terser()
]
}
})
const index = {
input: path.join(__dirname, '..', 'src', 'locale', 'index.js'),
output: {
file: path.join(__dirname, '..', 'dist', 'locale', 'index.js'),
format: 'umd',
name: `vdp_translation_index`
},
plugins: [
commonjs(),
babel({exclude: 'node_modules/**'}),
terser()
]
}
export default config.concat(index)