-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prevent the server plugin from running during the build (#2552)
* Prevent the server plugin from running during the build * Adds a changeset * More all before blocks to inside of a describe()
- Loading branch information
Showing
15 changed files
with
149 additions
and
136 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
'astro': patch | ||
--- | ||
|
||
Fixes build slowness on large apps | ||
|
||
This fixes slowness on large apps, particularly during the static build. Fix is to prevent the Vite dev server plugin from being run during build, as it is not needed. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,44 @@ | ||
import { expect } from 'chai'; | ||
import { loadFixture } from './test-utils.js'; | ||
|
||
let cwd = './fixtures/astro-jsx/'; | ||
let orders = [ | ||
['preact', 'react', 'solid'], | ||
['preact', 'solid', 'react'], | ||
['react', 'preact', 'solid'], | ||
['react', 'solid', 'preact'], | ||
['solid', 'react', 'preact'], | ||
['solid', 'preact', 'react'], | ||
]; | ||
let fixtures = {}; | ||
describe('JSX', () => { | ||
|
||
before(async () => { | ||
await Promise.all( | ||
orders.map((renderers, n) => | ||
loadFixture({ | ||
projectRoot: cwd, | ||
renderers: renderers.map((name) => `@astrojs/renderer-${name}`), | ||
dist: new URL(`${cwd}dist-${n}/`, import.meta.url), | ||
}).then((fixture) => { | ||
fixtures[renderers.toString()] = fixture; | ||
return fixture.build(); | ||
}) | ||
) | ||
); | ||
}); | ||
|
||
it('Renderer order', () => { | ||
it('JSX renderers can be defined in any order', async () => { | ||
if (!Object.values(fixtures).length) { | ||
throw new Error(`JSX renderers didn’t build properly`); | ||
} | ||
|
||
for (const [name, fixture] of Object.entries(fixtures)) { | ||
const html = await fixture.readFile('/index.html'); | ||
expect(html, name).to.be.ok; | ||
} | ||
let cwd = './fixtures/astro-jsx/'; | ||
let orders = [ | ||
['preact', 'react', 'solid'], | ||
['preact', 'solid', 'react'], | ||
['react', 'preact', 'solid'], | ||
['react', 'solid', 'preact'], | ||
['solid', 'react', 'preact'], | ||
['solid', 'preact', 'react'], | ||
]; | ||
let fixtures = {}; | ||
|
||
before(async () => { | ||
await Promise.all( | ||
orders.map((renderers, n) => | ||
loadFixture({ | ||
projectRoot: cwd, | ||
renderers: renderers.map((name) => `@astrojs/renderer-${name}`), | ||
dist: new URL(`${cwd}dist-${n}/`, import.meta.url), | ||
}).then((fixture) => { | ||
fixtures[renderers.toString()] = fixture; | ||
return fixture.build(); | ||
}) | ||
) | ||
); | ||
}); | ||
|
||
it('Renderer order', () => { | ||
it('JSX renderers can be defined in any order', async () => { | ||
if (!Object.values(fixtures).length) { | ||
throw new Error(`JSX renderers didn’t build properly`); | ||
} | ||
|
||
for (const [name, fixture] of Object.entries(fixtures)) { | ||
const html = await fixture.readFile('/index.html'); | ||
expect(html, name).to.be.ok; | ||
} | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.