mirror of
https://github.com/web-infra-dev/midscene.git
synced 2025-11-19 11:40:24 +00:00
* chore: add chrome devtools app * chore: resolve import error * chore: support visualizer css * add build logic * chore: add build extension zip file script * chore: migrate part of chrome extension content to app * chore: delete unless file * chore: optimize chrome devtool build script * chore: optimize chrome devtool build script * fix: resolve bridge mode test issues * chore: optimize chrome devtool build script * chore: optimize chrome devtool build script * chore: optimize chrome devtool build script * chore: update chrome devtools build process * chore: optimize chrome devtool build script * chore: optimize chrome devtool build script * chore: optimize chrome devtool build script * chore: optimize chrome devtool build script
78 lines
1.7 KiB
TypeScript
78 lines
1.7 KiB
TypeScript
import path from 'node:path';
|
|
import { defineConfig, moduleTools } from '@modern-js/module-tools';
|
|
import { modulePluginNodePolyfill } from '@modern-js/plugin-module-node-polyfill';
|
|
import { version } from './package.json';
|
|
const externals = ['playwright', 'bufferutil', 'utf-8-validate'];
|
|
|
|
const commonConfig = {
|
|
asset: {
|
|
svgr: true,
|
|
},
|
|
autoExternal: false,
|
|
externals: [...externals],
|
|
target: 'es2020',
|
|
minify: process.env.CI
|
|
? {
|
|
compress: true,
|
|
}
|
|
: undefined,
|
|
define: {
|
|
__VERSION__: version,
|
|
},
|
|
};
|
|
|
|
export default defineConfig({
|
|
buildConfig: [
|
|
{
|
|
...commonConfig,
|
|
alias: {
|
|
async_hooks: path.join(__dirname, './src/blank_polyfill.ts'),
|
|
},
|
|
format: 'umd',
|
|
dts: false,
|
|
input: {
|
|
report: 'src/index.tsx',
|
|
},
|
|
platform: 'browser',
|
|
outDir: 'dist',
|
|
target: 'es2020',
|
|
externals: [...externals],
|
|
},
|
|
{
|
|
...commonConfig,
|
|
alias: {
|
|
async_hooks: path.join(__dirname, './src/blank_polyfill.ts'),
|
|
},
|
|
dts: false,
|
|
input: {
|
|
extension: 'src/extension.tsx',
|
|
},
|
|
platform: 'browser',
|
|
outDir: 'dist',
|
|
target: 'es2020',
|
|
externals: [...externals, 'react', 'react-dom'],
|
|
},
|
|
{
|
|
...commonConfig,
|
|
alias: {
|
|
async_hooks: path.join(__dirname, './src/blank_polyfill.ts'),
|
|
},
|
|
format: 'iife',
|
|
dts: false,
|
|
input: {
|
|
'playground-entry': 'src/extension/playground-entry.tsx',
|
|
},
|
|
platform: 'browser',
|
|
outDir: 'unpacked-extension/lib',
|
|
target: 'es2020',
|
|
},
|
|
],
|
|
plugins: [
|
|
moduleTools(),
|
|
modulePluginNodePolyfill({
|
|
excludes: ['console'],
|
|
}),
|
|
],
|
|
buildPreset: 'npm-component',
|
|
});
|