-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 🗺 * remove sheet check * This should be working but its not. * Revert pretty css changes * still not working. * still not working. * still not working. * Its working! * Remove changes to site * Add snapshot * Simplify source map creation * Fix package.json * Update snapshots * Make the runtime smaller * Move regex into process.env.NODE_ENV !== 'production' check * Remove __emotion_source_map * Update snapshots and fix regex * Remove all the boilerplate in the App component of the site * comment out unused examples * Add checks for loc's existance and add a test for the css prop * Abstract away source map stuff * Don't output tagged template literals because the tagged template literal transform includes two copies of the strings * Increase sheet.js coverage - fix undefined showing up as source map * Remove console log * Add snapshots * Update snapshots * Test the illegal rule * Add source maps to objects calls of keyframes, injectGlobal and fontFace * Add pure comments to object call syntax * Simplify babel macro and add pure comments to object call syntax in babel macro * Add more tests for StyleSheet * Add docs for source maps * Add source-maps to site * Update docs * Add gif * Update docs
- Loading branch information
Kye Hohenberger
authored
Sep 24, 2017
1 parent
baf9b95
commit c34a46d
Showing
33 changed files
with
783 additions
and
415 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,48 @@ | ||
## Source Maps | ||
|
||
**babel plugin required** | ||
|
||
emotion supports source maps for styles authored in javascript. | ||
|
||
<div style='max-height: 480px;'> | ||
|
||
![source-map-demo](https://user-images.githubusercontent.com/662750/30778580-78fbeae4-a096-11e7-82e1-120b6984e875.gif) | ||
|
||
</div> | ||
|
||
Required For Source Maps: | ||
1. `babel-plugin-emotion` must be in your Babel setup. [[documentation]](https://github.com/emotion-js/emotion/blob/master/docs/install.md) | ||
2. `process.env.NODE_ENV` must be any value except `"production"` | ||
|
||
--- | ||
|
||
**We do not advise using sourceMaps in production. The source maps can add significant size to your bundle.** | ||
|
||
**Babel setup** | ||
|
||
**.babelrc** | ||
```json | ||
{ | ||
"plugins": [ | ||
["emotion", { "sourceMap": true }] | ||
] | ||
} | ||
``` | ||
|
||
**Recommended Setup** | ||
|
||
Use [Babel's `env` property](https://babeljs.io/docs/usage/babelrc/#env-option) and only set source maps in your development environment. | ||
|
||
**.babelrc** | ||
```json | ||
{ | ||
"env": { | ||
"production": { | ||
"plugins": [["emotion", { "sourceMap": false }]] | ||
}, | ||
"development": { | ||
"plugins": [["emotion", { "sourceMap": true }]] | ||
} | ||
} | ||
} | ||
``` |
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.