-
Notifications
You must be signed in to change notification settings - Fork 20
W react transform #4
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
Open
helols
wants to merge
6
commits into
keesun:dev
Choose a base branch
from
helols:w-react-transform
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
7fc8c72
Remove webjars
helols 1c54594
Ignore node_modules folder
helols 323e777
Add bootstrap webjars
helols 61fc479
Convert from JSX to ES2015
helols d2ca544
Enable webpack-dev-server
helols 9f622ba
Update README.md for webapp
helols 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 hidden or 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 |
|---|---|---|
|
|
@@ -2,4 +2,6 @@ | |
| *.iml | ||
| target/ | ||
| logs/ | ||
|
|
||
| node_modules/ | ||
| **/bundle.js | ||
| **/npm-debug.log | ||
This file contains hidden or 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 hidden or 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
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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,16 @@ | ||
| { | ||
| "stage": 0, | ||
| "plugins": [ | ||
| "react-transform" | ||
| ], | ||
| "extra": { | ||
| "react-transform": [{ | ||
| "target": "react-transform-webpack-hmr", | ||
| "imports": ["react"], | ||
| "locals": ["module"] | ||
| }, { | ||
| "target": "react-transform-catch-errors", | ||
| "imports": ["react", "redbox-react"] | ||
| }] | ||
| } | ||
| } |
This file contains hidden or 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,28 @@ | ||
| ### Install | ||
| Install node_modules(react/webpack/etc...) | ||
|
|
||
| ``` | ||
| npm install | ||
| ``` | ||
|
|
||
| ### Webpack | ||
|
|
||
| Build bundle.js : Make sure that bundle.js file src should be "scripts/bundle.js" | ||
|
|
||
| ``` | ||
| npm run build | ||
| ``` | ||
|
|
||
| Watch mode : Make sure that bundle.js file src should be "localhost:3003/bundle.js" | ||
|
|
||
| ``` | ||
| npm run watch | ||
| ``` | ||
|
|
||
| ### Folders | ||
|
|
||
| `components` - React components | ||
|
|
||
| `containers` - React pages | ||
|
|
||
| `styles` - css |
This file contains hidden or 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,34 @@ | ||
| import React, { Component } from 'react' | ||
|
|
||
| export default class Nav extends Component { | ||
| render() { | ||
| return ( | ||
| <nav className="navbar navbar-fixed-top"> | ||
| <div className="container"> | ||
| <div className="navbar-header"> | ||
| <button type="button" className="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar"> | ||
| <span className="sr-only">Toggle navigation</span> | ||
| <span className="icon-bar"></span> | ||
| <span className="icon-bar"></span> | ||
| <span className="icon-bar"></span> | ||
| </button> | ||
| <a className="navbar-brand" href="/">A.MU.GO.NA</a> | ||
| </div> | ||
| <div id="navbar" className="collapse navbar-collapse"> | ||
| <ul className="nav navbar-nav"> | ||
| <li className="active"><a href="/">Home</a></li> | ||
| <li><a href="#about">About</a></li> | ||
| <li><a href="#contact">Contact</a></li> | ||
| </ul> | ||
| <ul className="nav navbar-nav navbar-right"> | ||
| <li className="btn-group"> | ||
| <button type="button" className="btn btn-success navbar-btn">Sign up</button> | ||
| <button type="button" className="btn btn-default navbar-btn">Sign in</button> | ||
| </li> | ||
| </ul> | ||
| </div> | ||
| </div> | ||
| </nav> | ||
| ) | ||
| } | ||
| } |
This file contains hidden or 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 @@ | ||
| import React, { Component } from 'react' | ||
| import Home from './Home' | ||
| import Signup from './Signup' | ||
|
|
||
| export default class App extends Component { | ||
| constructor(props) { | ||
| super(props) | ||
| this.state = { route: window.location.hash.substr(1) } | ||
| } | ||
|
|
||
| componentDidMount() { | ||
| window.addEventListener('hashchange', () => { | ||
| this.setState({ | ||
| route: window.location.hash.substr(1) | ||
| }) | ||
| }) | ||
| } | ||
|
|
||
| render() { | ||
| var Child | ||
| switch (this.state.route) { | ||
| case "home": | ||
| Child = Home | ||
| break | ||
| case "signup": | ||
| Child = Signup | ||
| break | ||
| default: | ||
| Child = Home | ||
| } | ||
| return (<Child/>); | ||
| } | ||
| } |
This file contains hidden or 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 React, { Component } from 'react' | ||
| import Nav from '../components/Nav' | ||
|
|
||
| export default class Home extends Component { | ||
| render() { | ||
| return ( | ||
| <div> | ||
| <Nav/> | ||
| <div className="container"> | ||
| <div className="starter-template"> | ||
| <h1>Home Page</h1> | ||
| <p className="lead"> | ||
| Use this document as a way to quickly start any new project. | ||
| <br/> All you get is this text and a mostly barebones HTML document. | ||
| </p> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| ) | ||
| } | ||
| } |
This file contains hidden or 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 React, { Component } from 'react' | ||
| import Nav from '../components/Nav' | ||
|
|
||
| export default class Signup extends Component { | ||
| render() { | ||
| return ( | ||
| <div> | ||
| <Nav/> | ||
| <div className="container"> | ||
| <div className="starter-template"> | ||
| <h1>Sign-up Page</h1> | ||
| <p className="lead"> | ||
| Use this document as a way to quickly start any new project. | ||
| <br/> All you get is this text and a mostly barebones HTML document. | ||
| </p> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| ) | ||
| } | ||
| } |
This file contains hidden or 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 @@ | ||
| require('./styles/main.css') | ||
| import React from 'react' | ||
| import App from './containers/App' | ||
|
|
||
| React.render(<App />, document.getElementById('root')) |
This file contains hidden or 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": "amugona", | ||
| "version": "1.0.0", | ||
| "description": "What's up bro?", | ||
| "main": "index.js", | ||
| "scripts": { | ||
| "build": "webpack --progress --profile --colors", | ||
| "watch": "webpack-dev-server --progress --inline --hot --port 3003", | ||
| "test": "echo \"Error: no test specified\" && exit 1" | ||
| }, | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "git+ssh://git@github.com/keesun/amugona.git" | ||
| }, | ||
| "keywords": [ | ||
| "amugona", | ||
| "boot" | ||
| ], | ||
| "author": "keesun", | ||
| "license": "ISC", | ||
| "bugs": { | ||
| "url": "https://github.com/keesun/amugona/issues" | ||
| }, | ||
| "homepage": "https://github.com/keesun/amugona#readme", | ||
| "devDependencies": { | ||
| "babel-core": "^5.8.24", | ||
| "babel-loader": "^5.3.2", | ||
| "babel-plugin-react-transform": "^1.0.3", | ||
| "css-loader": "^0.18.0", | ||
| "react": "^0.13.3", | ||
| "react-transform-catch-errors": "^0.1.1", | ||
| "react-transform-webpack-hmr": "^0.1.4", | ||
| "redbox-react": "^1.0.3", | ||
| "style-loader": "^0.12.3", | ||
| "webpack": "^1.12.1", | ||
| "webpack-dev-server": "^1.10.1" | ||
| } | ||
| } |
File renamed without changes.
This file contains hidden or 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,24 @@ | ||
| var path = require('path'), | ||
| webpack = require('webpack'); | ||
|
|
||
| module.exports = { | ||
| devtool: 'cheap-module-eval-source-map', | ||
| entry: './main.js', | ||
| output: { | ||
| path: path.join(__dirname, '../static/scripts'), | ||
| filename: 'bundle.js', | ||
| }, | ||
| resolve: { | ||
| extensions: ['', '.js'] | ||
| }, | ||
| plugins: [ | ||
| new webpack.HotModuleReplacementPlugin(), | ||
| new webpack.NoErrorsPlugin() | ||
| ], | ||
| module: { | ||
| loaders: [ | ||
| {test: /\.js$/, loader: 'babel', exclude: /node_modules/}, | ||
| {test: /\.css$/, loader: 'style!css'} | ||
| ] | ||
| } | ||
| }; | ||
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.
@keesun
devtool: 'eval'빌드속도짱빠름..