|
1 | 1 | /* eslint-env node */ |
2 | 2 | import { esbuildPlugin } from '@web/dev-server-esbuild'; |
3 | 3 | import fs from 'node:fs'; |
4 | | -import path from 'node:path'; |
5 | 4 |
|
6 | 5 | const hasBaseParam = process.argv.includes('--base'); |
7 | 6 |
|
8 | | -/** @return {import('@web/test-runner').TestRunnerPlugin} */ |
9 | | -function generatedLitTestsPlugin() { |
10 | | - return { |
11 | | - name: 'generated-lit-tests', |
12 | | - transformImport({ source, context }) { |
13 | | - if (context.url.includes('-lit.generated.test.')) { |
14 | | - const dependencyPath = path.resolve(path.dirname(context.url), source); |
15 | | - |
16 | | - const litDependencyPath = dependencyPath |
17 | | - // /button/vaadin-button.js -> /button/vaadin-lit-button.js |
18 | | - .replace(/\/vaadin-(?!lit)([^/]+)/u, '/vaadin-lit-$1') |
19 | | - // /grid/all-imports.js -> /grid/lit-all-imports.js |
20 | | - .replace(/\/all-imports/u, '/lit-all-imports'); |
21 | | - |
22 | | - if (litDependencyPath !== dependencyPath && fs.existsSync(`.${litDependencyPath}`)) { |
23 | | - return litDependencyPath; |
24 | | - } |
25 | | - } |
26 | | - return source; |
27 | | - }, |
28 | | - }; |
29 | | -} |
30 | | - |
31 | 7 | /** @return {import('@web/test-runner').TestRunnerPlugin} */ |
32 | 8 | export function enforceBaseStylesPlugin() { |
33 | 9 | return { |
@@ -95,6 +71,5 @@ export default { |
95 | 71 | // When passing --base flag to `yarn start` command, load base styles and not Lumo |
96 | 72 | hasBaseParam && enforceBaseStylesPlugin(), |
97 | 73 | esbuildPlugin({ ts: true }), |
98 | | - generatedLitTestsPlugin(), |
99 | 74 | ].filter(Boolean), |
100 | 75 | }; |
0 commit comments