-
-
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.
- Loading branch information
Kye Hohenberger
committed
May 30, 2017
1 parent
b336678
commit 2057419
Showing
7 changed files
with
131 additions
and
0 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,9 @@ | ||
# emotion/glam example project | ||
|
||
## Start | ||
|
||
`npm install` | ||
|
||
`npm start` | ||
|
||
Go to `localhost:3000` |
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,38 @@ | ||
{ | ||
"name": "emotion-glam-example-project", | ||
"version": "1.0.0", | ||
"description": "emotion/glam example project", | ||
"scripts": { | ||
"start": "webpack-dev-server --content-base build/ --port 3000" | ||
}, | ||
"dependencies": { | ||
"glam": "^4.0.3", | ||
"react": "^15.5.4", | ||
"react-dom": "^15.5.4" | ||
}, | ||
"devDependencies": { | ||
"babel-core": "^6.23.1", | ||
"babel-eslint": "^7.2.3", | ||
"babel-loader": "^7.0.0", | ||
"babel-preset-es2015": "^6.22.0", | ||
"babel-preset-react": "^6.24.1", | ||
"css-loader": "^0.28.4", | ||
"emotion": "^0.0.6", | ||
"html-webpack-plugin": "^2.28.0", | ||
"standard": "^10.0.2", | ||
"webpack": "^2.2.0", | ||
"webpack-dev-server": "^2.4.5" | ||
}, | ||
"author": "Kye Hohenberger", | ||
"license": "MIT", | ||
"eslintConfig": { | ||
"extends": "standard", | ||
"parser": "babel-eslint" | ||
}, | ||
"standard": { | ||
"parser": "babel-eslint", | ||
"ignore": [ | ||
"/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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<!doctype html> | ||
<html> | ||
|
||
<head> | ||
<meta charset="utf-8" /> | ||
</head> | ||
|
||
<body> | ||
<div id="app"> | ||
|
||
</div> | ||
<script src="main.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
h1 { | ||
color: green; | ||
} |
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,21 @@ | ||
import './legacy.css' | ||
import './main.js.css' | ||
import React from 'react' | ||
import { render } from 'react-dom' | ||
import css, { fragment } from 'glam' | ||
|
||
function Profile ({ name, color }) { | ||
return ( | ||
<h1 | ||
className="old-legacy-className" | ||
css={` | ||
color: ${color}; | ||
font-size: 128px; | ||
`} | ||
> | ||
Hello {name} | ||
</h1> | ||
) | ||
} | ||
|
||
render(<Profile name="Dave" color="#4263eb" />, 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/* do not edit this file */ | ||
.css-rumnts { color: var(--css-rumnts-0); | ||
font-size: 128px; } |
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,42 @@ | ||
var path = require('path') | ||
var webpack = require('webpack') | ||
var HtmlWebpackPlugin = require('html-webpack-plugin') | ||
|
||
var loaders = [ | ||
{ | ||
test: /\.jsx?$/, | ||
exclude: /node_modules/, | ||
loader: 'babel-loader', | ||
query: { | ||
presets: ['babel-preset-es2015', 'react'], | ||
plugins: ['glam/babel', 'emotion/glam'] | ||
} | ||
}, | ||
{ | ||
test: /\.css?$/, | ||
loader: 'glam/loader' | ||
} | ||
] | ||
|
||
module.exports = { | ||
devtool: 'eval-source-map', | ||
entry: path.resolve('src', 'main.js'), | ||
output: { | ||
path: path.resolve('build'), | ||
filename: 'main.js', | ||
publicPath: '/' | ||
}, | ||
resolve: { | ||
extensions: ['.ts', '.tsx', '.js', '.jsx'] | ||
}, | ||
plugins: [ | ||
new HtmlWebpackPlugin({ | ||
template: path.resolve('src', 'index.tpl.html'), | ||
filename: 'index.html', | ||
inject: false | ||
}) | ||
], | ||
module: { | ||
loaders: loaders | ||
} | ||
} |