2024-08-04 08:28:19 +08:00
|
|
|
import { defineConfig, moduleTools } from '@modern-js/module-tools';
|
2025-01-07 11:10:28 +08:00
|
|
|
import { version } from './package.json';
|
2024-07-23 16:25:11 +08:00
|
|
|
|
|
|
|
export default defineConfig({
|
|
|
|
plugins: [moduleTools()],
|
|
|
|
buildPreset: 'npm-library',
|
|
|
|
buildConfig: {
|
2024-11-07 11:29:50 +08:00
|
|
|
format: 'cjs',
|
2024-07-23 16:25:11 +08:00
|
|
|
input: {
|
|
|
|
index: 'src/index.ts',
|
2025-01-07 11:10:28 +08:00
|
|
|
'bridge-mode': 'src/bridge-mode/index.ts',
|
|
|
|
'bridge-mode-browser': 'src/bridge-mode/browser.ts',
|
2024-11-05 11:49:21 +08:00
|
|
|
utils: 'src/common/utils.ts',
|
2024-12-16 15:04:21 +08:00
|
|
|
'ui-utils': 'src/common/ui-utils.ts',
|
2024-08-23 15:57:39 +08:00
|
|
|
debug: 'src/debug/index.ts',
|
|
|
|
puppeteer: 'src/puppeteer/index.ts',
|
|
|
|
playwright: 'src/playwright/index.ts',
|
2024-10-21 16:30:07 +08:00
|
|
|
playground: 'src/playground/index.ts',
|
|
|
|
'midscene-playground': 'src/playground/bin.ts',
|
2024-09-05 20:05:19 +08:00
|
|
|
appium: 'src/appium/index.ts',
|
2024-07-28 17:24:09 +08:00
|
|
|
'playwright-report': './src/playwright/reporter/index.ts',
|
2024-11-05 11:49:21 +08:00
|
|
|
'chrome-extension': 'src/chrome-extension/index.ts',
|
2024-12-25 20:23:12 +08:00
|
|
|
yaml: 'src/yaml/index.ts',
|
2024-07-23 16:25:11 +08:00
|
|
|
},
|
2024-11-07 11:29:50 +08:00
|
|
|
target: 'es2018',
|
2025-01-07 11:10:28 +08:00
|
|
|
externals: [
|
|
|
|
'@midscene/core',
|
|
|
|
'@midscene/shared',
|
|
|
|
'puppeteer',
|
|
|
|
'bufferutil',
|
|
|
|
'utf-8-validate',
|
|
|
|
],
|
|
|
|
define: {
|
|
|
|
__VERSION__: version,
|
|
|
|
},
|
2025-01-13 14:32:17 +08:00
|
|
|
// splitting: true,
|
2024-07-23 16:25:11 +08:00
|
|
|
},
|
|
|
|
});
|