chore: move vite root dir into template folder (#29081)

This commit is contained in:
Pavel Feldman 2024-01-23 09:40:05 -08:00 committed by GitHub
parent d89ed88679
commit 41c15cb176
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 4 additions and 4 deletions

View File

@ -24,6 +24,6 @@
</head>
<body>
<div id='root'></div>
<script type='module' src='/playwright/index.ts'></script>
<script type='module' src='/index.ts'></script>
</body>
</html>

View File

@ -76,8 +76,9 @@ export function createPlugin(
// Compose base config from the playwright config only.
const baseConfig: InlineConfig = {
root: configDir,
root: templateDir,
configFile: false,
publicDir: path.join(configDir, 'public'),
define: {
__VUE_PROD_DEVTOOLS__: true,
},
@ -189,7 +190,6 @@ export function createPlugin(
if (sourcesDirty) {
log('build');
await build(finalConfig);
await fs.promises.rename(`${finalConfig.build.outDir}/${relativeTemplateDir}/index.html`, `${finalConfig.build.outDir}/index.html`);
buildInfo.deps = Object.fromEntries(depsCollector.entries());
}

View File

@ -39,7 +39,7 @@ test('should work with the empty component list', async ({ runInlineTest }, test
expect(result.passed).toBe(1);
const output = result.output;
expect(output).toContain('transforming...');
expect(output.replace(/\\+/g, '/')).toContain('playwright/.cache/playwright/index.html');
expect(output.replace(/\\+/g, '/')).toContain('.cache/index.html');
const metainfo = JSON.parse(fs.readFileSync(testInfo.outputPath('playwright/.cache/metainfo.json'), 'utf-8'));
expect(metainfo.version).toEqual(require('playwright-core/package.json').version);