64 lines
1.4 KiB
JavaScript
Raw Normal View History

2019-04-15 18:35:01 +02:00
import babel from 'rollup-plugin-babel';
import resolve from 'rollup-plugin-node-resolve';
2019-04-16 09:38:15 +02:00
import commonjs from 'rollup-plugin-commonjs';
import svg from 'rollup-plugin-svg';
import postcss from 'rollup-plugin-postcss';
2019-04-17 11:18:40 +02:00
import rebasePlugin from 'rollup-plugin-rebase';
2019-04-18 00:32:21 +02:00
import { terser } from 'rollup-plugin-terser';
2019-04-26 14:29:02 +02:00
import replace from 'rollup-plugin-replace';
import filesize from 'rollup-plugin-filesize';
2019-04-15 18:35:01 +02:00
import pkg from './package.json';
export default {
2019-04-16 09:38:15 +02:00
input: './lib/src/index.js',
2019-04-15 18:35:01 +02:00
output: [
{
exports: 'named',
file: pkg.main,
format: 'cjs',
2019-04-18 00:32:21 +02:00
sourceMap: false,
2019-04-15 18:35:01 +02:00
name: 'strapi-helper-plugin',
2019-04-16 16:55:53 +02:00
compact: true,
2019-04-18 00:32:21 +02:00
globals: {
react: 'React',
'react-dom': 'ReactDOM',
},
2019-04-15 18:35:01 +02:00
},
{
exports: 'named',
2019-04-18 00:32:21 +02:00
sourceMap: false,
2019-04-15 18:35:01 +02:00
file: pkg.module,
format: 'es',
name: 'strapi-helper-plugin',
2019-04-16 16:55:53 +02:00
compact: true,
2019-04-18 00:32:21 +02:00
globals: {
react: 'React',
'react-dom': 'ReactDOM',
},
2019-04-15 18:35:01 +02:00
},
],
plugins: [
2019-04-16 09:38:15 +02:00
postcss({
modules: true,
2019-04-17 11:18:40 +02:00
minimize: true,
2019-04-16 09:38:15 +02:00
}),
2019-04-26 14:29:02 +02:00
rebasePlugin(),
resolve(),
2019-04-15 18:35:01 +02:00
babel({
exclude: 'node_modules/**',
}),
2019-04-16 09:38:15 +02:00
commonjs(),
svg(),
2019-04-18 00:32:21 +02:00
terser(),
2019-04-26 14:29:02 +02:00
filesize(),
replace({
'process.env.NODE_ENV': JSON.stringify('production'),
})
2019-04-16 09:38:15 +02:00
],
external: [
...Object.keys(pkg.dependencies || {}),
...Object.keys(pkg.peerDependencies || {}),
2019-04-15 18:35:01 +02:00
],
};