@leftfield-solutions/sharebase
Version:
Sharebase is a SharePoint Framework (SPFx) web part that provides a set of components to help you build SharePoint pages.
46 lines (43 loc) • 1.2 kB
JavaScript
import path from 'path';
import babel from '@rollup/plugin-babel';
import typescript from 'rollup-plugin-typescript2';
import peerDepsExternal from 'rollup-plugin-peer-deps-external';
import resolve from 'rollup-plugin-node-resolve';
import postcss from 'rollup-plugin-postcss';
export default {
onwarn(warning, warn) {
// Ignore circular dependency warnings
if (warning.code === 'CIRCULAR_DEPENDENCY') return;
if (warning.code === 'THIS_IS_UNDEFINED') return;
// Let Rollup handle other warnings
warn(warning);
},
input: path.resolve(__dirname, 'src/index.ts'),
output: [
{
file: path.resolve(__dirname, 'dist/index.js'),
format: 'cjs',
sourcemap: true
},
{
file: path.resolve(__dirname, 'dist/index.esm.js'),
format: 'esm',
sourcemap: true
}
],
plugins: [
peerDepsExternal(),
resolve({ preferBuiltins: true }), // This will silence the warning about crypto
typescript({
tsconfig: path.resolve(__dirname, 'tsconfig.json')
}),
babel({
babelHelpers: 'bundled',
presets: ['@babel/preset-env'],
exclude: 'node_modules/**'
}),
postcss({
plugins: []
})
]
};