Last active
April 16, 2018 23:38
-
-
Save shawnbot/53600929cc8735e8e4fe26a960c0d4cb to your computer and use it in GitHub Desktop.
Parcel + Preact
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
Show hidden characters
{ | |
"presets": ["env", "react"] | |
} |
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
node_modules | |
.cache | |
dist/ |
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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<title>Parcel + React test</title> | |
</head> | |
<body> | |
<div id="app"></div> | |
<script src="./index.js"></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
import React from 'react' | |
import {render} from 'react-dom' | |
import styled from 'styled-components' | |
const Box = styled.div` | |
background-color: #eee; | |
border: 1px solid #999; | |
padding: 1em; | |
> * { | |
margin: 0; | |
} | |
` | |
render(( | |
<Box> | |
<h1>Hello, world!</h1> | |
</Box> | |
), document.getElementById('app')) |
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
{ | |
"private": true, | |
"main": "index.js", | |
"scripts": { | |
"start": "parcel index.html", | |
"prebuild": "rm -rf dist", | |
"build": "NODE_ENV=production parcel build", | |
"postbuild": "gzip-size dist/*.js" | |
}, | |
"keywords": [], | |
"author": "", | |
"license": "ISC", | |
"devDependencies": { | |
"babel-preset-env": "^1.6.1", | |
"babel-preset-react": "^6.24.1", | |
"gzip-size-cli": "^2.1.0", | |
"parcel-bundler": "^1.7.1" | |
}, | |
"dependencies": { | |
"react": "^16.3.2", | |
"react-dom": "^16.3.2", | |
"styled-components": "^3.2.5" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment