Tailwind thing
This commit is contained in:
parent
c5e134d035
commit
24f3212a21
5 changed files with 69 additions and 1 deletions
|
@ -150,5 +150,22 @@ describe('Scripts (hoisted and not)', () => {
|
|||
});
|
||||
expect(found).to.equal(1);
|
||||
});
|
||||
|
||||
it.only('Using injectScript does not interfere', async () => {
|
||||
let res = await fixture.fetch('/inline-in-page');
|
||||
let html = await res.text();
|
||||
let $ = cheerio.load(html);
|
||||
//console.log(html);
|
||||
let found = 0;
|
||||
let moduleScripts = $('[type=module]');
|
||||
moduleScripts.each((i, el) => {
|
||||
if (
|
||||
$(el).attr('src').includes('?astro&type=script&index=0&lang.ts')
|
||||
) {
|
||||
found++;
|
||||
}
|
||||
});
|
||||
expect(found).to.equal(1);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
36
packages/astro/test/fixtures/astro-scripts/astro.config.mjs
vendored
Normal file
36
packages/astro/test/fixtures/astro-scripts/astro.config.mjs
vendored
Normal file
|
@ -0,0 +1,36 @@
|
|||
import { defineConfig } from 'astro/config';
|
||||
import tailwind from '@astrojs/tailwind';
|
||||
|
||||
export default defineConfig({
|
||||
integrations: [
|
||||
tailwind()
|
||||
// {
|
||||
// name: '@test-inject-script',
|
||||
// hooks: {
|
||||
// 'astro:config:setup'({ injectScript, updateConfig }) {
|
||||
// injectScript('page-ssr', `import 'virtual:test';`);
|
||||
// updateConfig({
|
||||
// vite: {
|
||||
// plugins: [
|
||||
// {
|
||||
// name: '@test-inject-script',
|
||||
// resolveId(id) {
|
||||
// if(id === 'virtual:test') {
|
||||
// return id;
|
||||
// }
|
||||
// },
|
||||
// load(id) {
|
||||
// if(id === 'virtual:test') {
|
||||
// console.log('loading it');
|
||||
// return 'export default void 0;'
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// ]
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
]
|
||||
})
|
|
@ -3,6 +3,7 @@
|
|||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"astro": "workspace:*"
|
||||
"astro": "workspace:*",
|
||||
"@astrojs/tailwind": "workspace:*"
|
||||
}
|
||||
}
|
||||
|
|
12
packages/astro/test/fixtures/astro-scripts/src/pages/inline-in-page.astro
vendored
Normal file
12
packages/astro/test/fixtures/astro-scripts/src/pages/inline-in-page.astro
vendored
Normal file
|
@ -0,0 +1,12 @@
|
|||
|
||||
<html>
|
||||
<head>
|
||||
<title>Testing</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Testing</h1>
|
||||
<script>
|
||||
console.log('hi');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -1356,8 +1356,10 @@ importers:
|
|||
|
||||
packages/astro/test/fixtures/astro-scripts:
|
||||
specifiers:
|
||||
'@astrojs/tailwind': workspace:*
|
||||
astro: workspace:*
|
||||
dependencies:
|
||||
'@astrojs/tailwind': link:../../../../integrations/tailwind
|
||||
astro: link:../../..
|
||||
|
||||
packages/astro/test/fixtures/astro-sitemap-rss:
|
||||
|
|
Loading…
Reference in a new issue