Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build locales #52

Merged
merged 3 commits into from
Nov 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,4 @@ yarn-error.log
dist
en
e2e_test
locales.js
32 changes: 0 additions & 32 deletions locales.js

This file was deleted.

13 changes: 13 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import babel from 'rollup-plugin-babel'
import commonjs from 'rollup-plugin-commonjs'
import replace from 'rollup-plugin-replace'
import uploadcare from 'uploadcare-widget'

export default [
// esm build width all locales
Expand Down Expand Up @@ -71,5 +72,17 @@ export default [
}),
babel()
]
},

{
input: 'src/langs.js',
output: {
format: 'esm',
file: 'locales.js',
sourcemap: false
},
plugins: [
replace({ __LANGS__: JSON.stringify(uploadcare.locales) })
]
}
]
3 changes: 1 addition & 2 deletions src/dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,7 @@ const Dialog = props => {
setState({
opened: true,
sourse: 'natural'
})
}
})}
>
Open panel
</button>
Expand Down
2 changes: 2 additions & 0 deletions src/langs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// eslint-disable-next-line no-undef
export default __LANGS__