/
githubmirror
/
meteor
Обзор
Документация
Войти
/
githubmirror
/
meteor
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
devel
tools/e2e-tests/apps/react/plugins/demo-unplugin.js
30 строк
831 B
Nacho Codoñer
add demo unplugin to Rspack config and E2E tests for cache tracking
30 мар 2026, 17:28
30 мар 2026, 17:28
8cc1efa
Код
Авторство
О чём код?
const { createUnplugin } = require('unplugin'); const demoUnplugin = createUnplugin(() => { console.log('[demo-unplugin][factory-created]'); return { name: 'demo-unplugin', transformInclude(id) { // Only process app source files, skip node_modules and .meteor if (id.includes('node_modules') || id.includes('.meteor')) { return false; } const ok = id.endsWith('.tsx') || id.endsWith('.ts') || id.endsWith('.jsx') || id.endsWith('.js'); if (ok) { console.log('[demo-unplugin][transformInclude]', id, '=> true'); } return ok; }, transform(code, id) { console.log('[demo-unplugin][transform-enter]', id); return { code, map: null }; }, }; }); module.exports = { demoRspackPlugin: demoUnplugin.rspack };