From 4fe06d4fe23717d35f54cd1c4a3c5d9e49b3e2d4 Mon Sep 17 00:00:00 2001 From: Pig Fang Date: Sun, 5 Feb 2023 15:27:24 +0800 Subject: [PATCH] simplify Rollup config --- rollup.config.ts | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/rollup.config.ts b/rollup.config.ts index a11f8a8..1d832b4 100644 --- a/rollup.config.ts +++ b/rollup.config.ts @@ -14,15 +14,8 @@ function makeConfig(name: string, path: string) { input: { [name]: path }, output: { dir: './plugins', - format: 'iife', - globals: { - 'blessing-skin': 'blessing', - react: 'React', - 'react-dom': 'ReactDOM', - }, - indent: ' ', + format: 'esm', }, - external: ['react', 'react-dom', 'blessing-skin'], plugins: [ replace({ values: { @@ -54,11 +47,10 @@ function makeConfig(name: string, path: string) { export default glob([ 'plugins/*/assets/**/*.ts', - 'plugins/*/assets/**/*.tsx', '!plugins/*/assets/**/*.test.ts', '!**/*.d.ts', ]).then((files) => files.map((file) => - makeConfig(file.replace('plugins/', '').replace(/\.tsx?$/g, ''), file), + makeConfig(file.replace('plugins/', '').replace(/\.ts$/g, ''), file), ), )