-
Notifications
You must be signed in to change notification settings - Fork 206
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
1 parent
bf9bf77
commit 456b784
Showing
6 changed files
with
115 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,33 @@ | ||
const path = require('path'); | ||
const express = require('express'); | ||
const webpack = require('webpack'); | ||
const config = require('./webpack.config.development'); | ||
const port = 8080; | ||
|
||
const app = express(); | ||
const compiler = webpack(config); | ||
|
||
|
||
app.use(require('webpack-dev-middleware')(compiler, { | ||
publicPath: config.output.publicPath, | ||
stats: { | ||
colors: true | ||
} | ||
})); | ||
|
||
app.use(require('webpack-hot-middleware')(compiler)); | ||
|
||
app.get('*', (req, resp) => { | ||
resp.sendFile(path.join(__dirname, './spec/index.html')); | ||
}); | ||
|
||
app.listen(port, '0.0.0.0', (err) => { | ||
if (err) { | ||
console.log(err); | ||
return; | ||
} | ||
|
||
console.log(path.join(__dirname, './spec/index.html')); | ||
|
||
console.log('Listening at http://0.0.0.0:' + port); | ||
}); |
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,13 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>Document</title> | ||
<link href='https://fonts.googleapis.com/css?family=Roboto:400,300,500' rel='stylesheet' type='text/css'> | ||
<link rel="stylesheet" href="/build/spec.css"> | ||
</head> | ||
<body> | ||
<div id="flexboxgrid-test"></div> | ||
<script src="/build/spec.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,5 @@ | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import Root from './root'; | ||
|
||
ReactDOM.render(<Root />, document.getElementById('flexboxgrid-test')); |
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,12 @@ | ||
/* global VERSION */ | ||
require('./style'); | ||
|
||
import React from 'react'; | ||
import {Grid} from '../src/index'; | ||
|
||
const Root = () => ( | ||
<Grid>Hello World, Roy Lee</Grid> | ||
); | ||
|
||
|
||
export default Root; |
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,7 @@ | ||
html { | ||
font-family: 'Roboto', sans-serif | ||
} | ||
|
||
body, h1, h2, h3, h4, h5, h6 { | ||
margin: 0 | ||
} |
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 @@ | ||
const pkg = require('./package'); | ||
const webpack = require('webpack'); | ||
const path = require('path'); | ||
const autoprefixer = require('autoprefixer'); | ||
const ExtractTextPlugin = require('extract-text-webpack-plugin'); | ||
|
||
module.exports = { | ||
context: __dirname, | ||
devtool: 'inline-source-map', | ||
entry: [ | ||
'webpack-hot-middleware/client', | ||
'./spec/index.js' | ||
], | ||
output: { | ||
path: path.join(__dirname, 'build'), | ||
publicPath: '/build/', | ||
filename: 'spec.js' | ||
}, | ||
resolve: { | ||
extensions: ['', '.js', '.scss', '.json'] | ||
}, | ||
module: { | ||
loaders: [ | ||
{ | ||
test: /\.js$/, | ||
exclude: /(node_modules)/, | ||
loader: 'babel' | ||
}, | ||
{ | ||
test: /(\.scss|\.css)$/, | ||
loader: ExtractTextPlugin.extract('style-loader', 'css?sourceMap&modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!postcss!sass?sourceMap') | ||
} | ||
] | ||
}, | ||
postcss: [autoprefixer], | ||
plugins: [ | ||
new ExtractTextPlugin('spec.css', {allChunks: true}), | ||
new webpack.HotModuleReplacementPlugin(), | ||
new webpack.NoErrorsPlugin(), | ||
new webpack.DefinePlugin({ | ||
'process.env.NODE_ENV': JSON.stringify('development'), | ||
VERSION: JSON.stringify(pkg.version) | ||
}) | ||
] | ||
}; |