-
-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathrollup.config.js
More file actions
33 lines (29 loc) · 841 Bytes
/
rollup.config.js
File metadata and controls
33 lines (29 loc) · 841 Bytes
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
import babel from '@rollup/plugin-babel';
import commonjs from '@rollup/plugin-commonjs';
import nodeResolve from '@rollup/plugin-node-resolve';
import { terser } from "rollup-plugin-terser";
import { argv } from 'yargs';
const format = argv.format || argv.f || 'iife';
const compress = argv.uglify;
const babelOptions = {
babelrc: false
};
const file = {
amd: `dist/amd/i18nextFluent${compress ? '.min' : ''}.js`,
umd: `dist/umd/i18nextFluent${compress ? '.min' : ''}.js`,
iife: `dist/iife/i18nextFluent${compress ? '.min' : ''}.js`
}[format];
export default {
input: 'src/index.js',
plugins: [
babel(babelOptions),
nodeResolve({ jsnext: true, main: true }),
commonjs({})
].concat(compress ? terser() : []),
//moduleId: 'i18nextXHRBackend',
output: {
name: 'i18nextFluent',
format,
file
}
};