-
-
Notifications
You must be signed in to change notification settings - Fork 268
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(dev-server): don't deepmerge exportConditions. allow user config…
… to fully replace the default
- Loading branch information
1 parent
b20cc19
commit d9996d2
Showing
5 changed files
with
54 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@web/dev-server': patch | ||
--- | ||
|
||
Fix an issue where the nodeResolve plugin wasn't accepting user configuration correctly |
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,10 @@ | ||
import { fileURLToPath } from 'url'; | ||
import { resolve } from 'path'; | ||
|
||
export default { | ||
rootDir: resolve(fileURLToPath(import.meta.url), '..', '..', '..'), | ||
appIndex: '/demo/export-conditions/index.html', | ||
nodeResolve: { | ||
exportConditions: ['default'] | ||
}, | ||
}; |
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,31 @@ | ||
<html> | ||
<body> | ||
<img width="100" src="../logo.png" /> | ||
|
||
<h1>Node resolve demo</h1> | ||
<p>A demo which resolves bare module imports</p> | ||
|
||
<div id="test"></div> | ||
|
||
<script type="module"> | ||
// inline bare modules are resolved | ||
import { render, html } from 'lit-html'; | ||
|
||
window.__inlineNodeResolve = !!render && !!html; | ||
</script> | ||
|
||
<script type="module"> | ||
|
||
window.__tests = { | ||
// lit-html only adds this global in development mode | ||
// so when the exportCondition is overwritten, it'll be undefined | ||
prodExport: typeof window.litIssuedWarnings === 'undefined', | ||
}; | ||
document.getElementById('test').innerHTML = `<pre>${JSON.stringify( | ||
window.__tests, | ||
null, | ||
2, | ||
)}</pre>`; | ||
</script> | ||
</body> | ||
</html> |
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