mirror of
https://github.com/tenrok/BBob.git
synced 2026-06-17 19:21:20 +03:00
refactor(*): convert to babel and generation to lib, es, dist folders (#2)
* refactor(*): convert to babel and generation to lib, es, dist * chore(*): remove generated files * fix(*): lint run command
This commit is contained in:
committed by
GitHub
parent
d22a2895a4
commit
32a7fb51da
@@ -0,0 +1,66 @@
|
||||
import nodeResolve from 'rollup-plugin-node-resolve';
|
||||
import babel from 'rollup-plugin-babel';
|
||||
import replace from 'rollup-plugin-replace';
|
||||
import commonjs from 'rollup-plugin-commonjs';
|
||||
import { uglify } from 'rollup-plugin-uglify';
|
||||
|
||||
const pkg = require(`${process.cwd()}/package.json`);
|
||||
const env = process.env.NODE_ENV;
|
||||
|
||||
const globals = {
|
||||
react: 'React',
|
||||
vue: 'Vue',
|
||||
};
|
||||
const external = ['react', 'vue'];
|
||||
|
||||
const input = 'src/index.js';
|
||||
|
||||
const plugins = [
|
||||
nodeResolve(),
|
||||
babel({
|
||||
exclude: '**/node_modules/**',
|
||||
}),
|
||||
replace({
|
||||
'process.env.NODE_ENV': JSON.stringify(env),
|
||||
}),
|
||||
commonjs(),
|
||||
];
|
||||
|
||||
|
||||
export default [
|
||||
{
|
||||
input,
|
||||
external,
|
||||
output: {
|
||||
file: pkg.browser,
|
||||
format: 'umd',
|
||||
name: pkg.browserName,
|
||||
globals: {
|
||||
react: 'React',
|
||||
vue: 'Vue',
|
||||
},
|
||||
},
|
||||
plugins,
|
||||
},
|
||||
{
|
||||
input,
|
||||
external,
|
||||
output: {
|
||||
file: pkg.browser.replace('.js', '.min.js'),
|
||||
format: 'umd',
|
||||
name: pkg.browserName,
|
||||
globals,
|
||||
},
|
||||
plugins: [
|
||||
...plugins,
|
||||
uglify({
|
||||
compress: {
|
||||
pure_getters: true,
|
||||
unsafe: true,
|
||||
unsafe_comps: true,
|
||||
warnings: false,
|
||||
},
|
||||
}),
|
||||
],
|
||||
},
|
||||
];
|
||||
Reference in New Issue
Block a user