You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
693 B
JavaScript
29 lines
693 B
JavaScript
3 years ago
|
import commonjs from '@rollup/plugin-commonjs';
|
||
|
import { nodeResolve } from '@rollup/plugin-node-resolve';
|
||
|
import replace from '@rollup/plugin-replace';
|
||
|
import typescript from '@rollup/plugin-typescript';
|
||
|
import { defineConfig } from 'rollup';
|
||
|
|
||
|
export default defineConfig({
|
||
|
input: './src/index.tsx',
|
||
|
plugins: [
|
||
|
commonjs(),
|
||
|
nodeResolve(),
|
||
|
typescript(),
|
||
|
replace({
|
||
|
preventAssignment: false,
|
||
|
'process.env.NODE_ENV': JSON.stringify('production'),
|
||
|
}),
|
||
|
],
|
||
|
context: 'window',
|
||
|
external: ['react', 'react-dom'],
|
||
|
output: {
|
||
|
file: 'dist/example-plugin.js',
|
||
|
globals: {
|
||
|
react: 'SP_REACT',
|
||
|
},
|
||
|
format: 'iife',
|
||
|
exports: 'default',
|
||
|
},
|
||
|
});
|