-
Notifications
You must be signed in to change notification settings - Fork 915
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
improve CSS module support, swap out outdated engine for postcss #1666
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,76 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`snowpack build css-modules: allFiles 1`] = ` | ||
Array [ | ||
"__snowpack__/env.js", | ||
"src/App.js", | ||
"src/App.module.css", | ||
"src/App.module.css.proxy.js", | ||
] | ||
`; | ||
|
||
exports[`snowpack build css-modules: build/__snowpack__/env.js 1`] = `"export default {\\"MODE\\":\\"production\\",\\"NODE_ENV\\":\\"production\\",\\"SSR\\":false};"`; | ||
|
||
exports[`snowpack build css-modules: build/src/App.js 1`] = ` | ||
"import foo from \\"./App.module.css.proxy.js\\"; | ||
console.log(foo);" | ||
`; | ||
|
||
exports[`snowpack build css-modules: build/src/App.module.css 1`] = ` | ||
".App { | ||
text-align: center; | ||
} | ||
.App code { | ||
background: #FFF3; | ||
padding: 4px 8px; | ||
border-radius: 4px; | ||
} | ||
.App p { | ||
margin: 0.4rem; | ||
} | ||
.App-logo { | ||
height: 40vmin; | ||
pointer-events: none; | ||
} | ||
@media (prefers-reduced-motion: no-preference) { | ||
.App-logo { | ||
animation: App-logo-spin infinite 20s linear; | ||
} | ||
} | ||
.App-header { | ||
background-color: #282c34; | ||
min-height: 100vh; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: center; | ||
font-size: calc(10px + 2vmin); | ||
color: white; | ||
} | ||
.App-link { | ||
color: #61dafb; | ||
} | ||
@keyframes App-logo-spin { | ||
from { | ||
transform: rotate(0deg); | ||
} | ||
to { | ||
transform: rotate(360deg); | ||
} | ||
}" | ||
`; | ||
|
||
exports[`snowpack build css-modules: build/src/App.module.css.proxy.js 1`] = ` | ||
" | ||
export let code = \\"._App_10m0p_1 { text-align: center;}._App_10m0p_1 code { background: #FFF3; padding: 4px 8px; border-radius: 4px;}._App_10m0p_1 p { margin: 0.4rem;}._App-logo_10m0p_12 { height: 40vmin; pointer-events: none;}@media (prefers-reduced-motion: no-preference) { ._App-logo_10m0p_12 { animation: _App-logo-spin_10m0p_1 infinite 20s linear; }}._App-header_10m0p_23 { background-color: #282c34; min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: calc(10px + 2vmin); color: white;}._App-link_10m0p_34 { color: #61dafb;}@keyframes _App-logo-spin_10m0p_1 { from { transform: rotate(0deg); } to { transform: rotate(360deg); }}\\"; | ||
let json = {\\"App\\":\\"_App_10m0p_1\\",\\"App-logo\\":\\"_App-logo_10m0p_12\\",\\"App-logo-spin\\":\\"_App-logo-spin_10m0p_1\\",\\"App-header\\":\\"_App-header_10m0p_23\\",\\"App-link\\":\\"_App-link_10m0p_34\\"}; | ||
export default json; | ||
// [snowpack] add styles to the page (skip if no document exists) | ||
if (typeof document !== 'undefined') { | ||
const styleEl = document.createElement(\\"style\\"); | ||
const codeEl = document.createTextNode(code); | ||
styleEl.type = 'text/css'; | ||
styleEl.appendChild(codeEl); | ||
document.head.appendChild(styleEl); | ||
}" | ||
`; |
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,22 @@ | ||
{ | ||
"private": true, | ||
"version": "1.0.1", | ||
"name": "@snowpack/test-css-modules", | ||
"description": "Tests CSS Module support", | ||
"scripts": { | ||
"testbuild": "snowpack build" | ||
}, | ||
"snowpack": { | ||
"mount": { | ||
"./src": "/src" | ||
} | ||
}, | ||
"dependencies": { | ||
"water.css": "^2.0.0" | ||
}, | ||
"devDependencies": { | ||
"@snowpack/plugin-optimize": "^0.2.6", | ||
"@snowpack/plugin-sass": "^1.1.1", | ||
"snowpack": "^2.14.3" | ||
} | ||
} |
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 @@ | ||
import foo from './App.module.css'; | ||
console.log(foo); |
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,45 @@ | ||
.App { | ||
text-align: center; | ||
} | ||
.App code { | ||
background: #FFF3; | ||
padding: 4px 8px; | ||
border-radius: 4px; | ||
} | ||
.App p { | ||
margin: 0.4rem; | ||
} | ||
.App-logo { | ||
height: 40vmin; | ||
pointer-events: none; | ||
} | ||
|
||
@media (prefers-reduced-motion: no-preference) { | ||
.App-logo { | ||
animation: App-logo-spin infinite 20s linear; | ||
} | ||
} | ||
|
||
.App-header { | ||
background-color: #282c34; | ||
min-height: 100vh; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: center; | ||
font-size: calc(10px + 2vmin); | ||
color: white; | ||
} | ||
|
||
.App-link { | ||
color: #61dafb; | ||
} | ||
|
||
@keyframes App-logo-spin { | ||
from { | ||
transform: rotate(0deg); | ||
} | ||
to { | ||
transform: rotate(360deg); | ||
} | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏻