Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
105 changed files
with
2,355 additions
and
834 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
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
hoist-pattern[]=*eslint* | ||
hoist-pattern[]=*babel* | ||
hoist-pattern[]=*jest* | ||
hoist-pattern[]=@emotion/* | ||
hoist-pattern[]=postcss | ||
hoist-pattern[]=pug | ||
hoist-pattern[]=source-map-support |
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
Binary file not shown.
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 |
---|---|---|
|
@@ -10,5 +10,8 @@ | |
}, | ||
"dependencies": { | ||
"tailwindcss": "^2.2.19" | ||
}, | ||
"devDependencies": { | ||
"fast-glob": "^3.2.11" | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
packages/playground/css/__tests__/postcss-plugins-different-dir.spec.ts
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,29 @@ | ||
import { getColor, getBgColor } from '../../testUtils' | ||
import { createServer } from 'vite' | ||
import path from 'path' | ||
|
||
// Regression test for https://github.com/vitejs/vite/issues/4000 | ||
test('postcss plugins in different dir', async () => { | ||
const port = 5005 | ||
const server = await createServer({ | ||
root: path.join(__dirname, '..', '..', 'tailwind'), | ||
logLevel: 'silent', | ||
server: { | ||
port, | ||
strictPort: true | ||
}, | ||
build: { | ||
// skip transpilation during tests to make it faster | ||
target: 'esnext' | ||
} | ||
}) | ||
await server.listen() | ||
try { | ||
await page.goto(`http://localhost:${port}`) | ||
const tailwindStyle = await page.$('.tailwind-style') | ||
expect(await getBgColor(tailwindStyle)).toBe('rgb(254, 226, 226)') | ||
expect(await getColor(tailwindStyle)).toBe('rgb(136, 136, 136)') | ||
} finally { | ||
await server.close() | ||
} | ||
}) |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
VITE_PARENT_ENV=dont_load_me |
15 changes: 15 additions & 0 deletions
15
packages/playground/env-nested/__tests__/env-nested.spec.ts
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,15 @@ | ||
import { isBuild } from 'testUtils' | ||
|
||
const mode = isBuild ? `production` : `development` | ||
|
||
test('mode', async () => { | ||
expect(await page.textContent('.mode')).toBe(mode) | ||
}) | ||
|
||
test('mode file override', async () => { | ||
expect(await page.textContent('.mode-file')).toBe(`.env.${mode}`) | ||
}) | ||
|
||
test('should not load parent .env file', async () => { | ||
expect(await page.textContent('.parent-env')).not.toBe('dont_load_me') | ||
}) |
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 @@ | ||
VITE_EFFECTIVE_MODE_FILE_NAME=.env.development |
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 @@ | ||
VITE_EFFECTIVE_MODE_FILE_NAME=.env.production |
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,16 @@ | ||
<h1>Nested Environment Variables</h1> | ||
<p>import.meta.env.MODE: <code class="mode"></code></p> | ||
<p> | ||
import.meta.env.VITE_EFFECTIVE_MODE_FILE_NAME: <code class="mode-file"></code> | ||
</p> | ||
<p>Empty import.meta.env.VITE_PARENT_ENV: <code class="parent-env"></code></p> | ||
|
||
<script type="module"> | ||
text('.mode', import.meta.env.MODE) | ||
text('.mode-file', import.meta.env.VITE_EFFECTIVE_MODE_FILE_NAME) | ||
text('.parent-env', import.meta.env.VITE_PARENT_ENV) | ||
|
||
function text(el, text) { | ||
document.querySelector(el).textContent = text | ||
} | ||
</script> |
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,11 @@ | ||
{ | ||
"name": "test-env-nested", | ||
"private": true, | ||
"version": "0.0.0", | ||
"scripts": { | ||
"dev": "vite", | ||
"build": "vite build", | ||
"debug": "node --inspect-brk ../../vite/bin/vite", | ||
"preview": "vite preview" | ||
} | ||
} |
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,5 @@ | ||
const { defineConfig } = require('vite') | ||
|
||
module.exports = defineConfig({ | ||
envDir: './envs' | ||
}) |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
KEY=safe |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
export default 'hi' |
Oops, something went wrong.