Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
71 lines
1.4 KiB
Plaintext
71 lines
1.4 KiB
Plaintext
import nodeResolve from '@rollup/plugin-node-resolve';
|
|
import { terser } from 'rollup-plugin-terser';
|
|
import replace from '@rollup/plugin-replace';
|
|
import commonjs from '@rollup/plugin-commonjs';
|
|
import babel from '@rollup/plugin-babel';
|
|
|
|
const defaultNodeResolveConfig = {};
|
|
const nodeResolvePlugin = nodeResolve(defaultNodeResolveConfig);
|
|
|
|
const commonPlugins = [
|
|
nodeResolvePlugin,
|
|
babel.default({
|
|
presets: ['@babel/preset-env'],
|
|
babelHelpers: 'bundled',
|
|
}),
|
|
commonjs(),
|
|
];
|
|
|
|
const developmentPlugins = [
|
|
...commonPlugins,
|
|
replace({
|
|
'process.env.NODE_ENV': JSON.stringify('development'),
|
|
}),
|
|
];
|
|
|
|
const productionPlugins = [
|
|
...commonPlugins,
|
|
replace({
|
|
'process.env.NODE_ENV': JSON.stringify('production'),
|
|
}),
|
|
terser({ mangle: false }),
|
|
];
|
|
|
|
export default [
|
|
{
|
|
input: 'src/index.js',
|
|
output: {
|
|
file: 'lib/cjs/state-local.js',
|
|
format: 'cjs',
|
|
exports: 'default',
|
|
},
|
|
plugins: commonPlugins,
|
|
},
|
|
{
|
|
input: 'src/index.js',
|
|
output: {
|
|
file: 'lib/es/state-local.js',
|
|
format: 'es',
|
|
},
|
|
plugins: commonPlugins,
|
|
},
|
|
{
|
|
input: 'src/index.js',
|
|
output: {
|
|
file: 'lib/umd/state-local.js',
|
|
format: 'umd',
|
|
name: 'state',
|
|
},
|
|
plugins: developmentPlugins,
|
|
},
|
|
{
|
|
input: 'src/index.js',
|
|
output: {
|
|
file: 'lib/umd/state-local.min.js',
|
|
format: 'umd',
|
|
name: 'state',
|
|
},
|
|
plugins: productionPlugins,
|
|
},
|
|
];
|