-
Notifications
You must be signed in to change notification settings - Fork 922
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(core): allow non-default-export client config file (#1564)
Co-authored-by: meteorlxy <[email protected]>
- Loading branch information
1 parent
5615fd3
commit d3b3cc4
Showing
7 changed files
with
35 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { getDirname, path } from 'vuepress/utils' | ||
|
||
const __dirname = getDirname(import.meta.url) | ||
|
||
export const fooPlugin = { | ||
name: 'test-plugin', | ||
clientConfigFile: path.resolve( | ||
__dirname, | ||
'./nonDefaultExportClientConfig.js', | ||
), | ||
} |
2 changes: 2 additions & 0 deletions
2
e2e/docs/.vuepress/plugins/foo/nonDefaultExportClientConfig.js
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,2 @@ | ||
// test non-default-export clientConfig | ||
import './test.css' |
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,3 @@ | ||
#non-default-export { | ||
font-size: 123px; | ||
} |
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 @@ | ||
# non-default-export |
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 @@ | ||
import { expect, test } from '@playwright/test' | ||
|
||
test('should apply styles correctly if the client config file does not have default export', async ({ | ||
page, | ||
}) => { | ||
await page.goto('client-config/non-default-export.html') | ||
await expect(page.locator('#non-default-export')).toHaveCSS( | ||
'font-size', | ||
'123px', | ||
) | ||
}) |
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