Skip to content

Commit

Permalink
most basic-ist of all basics
Browse files Browse the repository at this point in the history
  • Loading branch information
mengchengfeng committed Jun 10, 2017
0 parents commit dc20158
Show file tree
Hide file tree
Showing 8 changed files with 77 additions and 0 deletions.
1 change: 1 addition & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ presets: ['react']}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/node_modules/
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Basic React app template from Codeacademy
7 changes: 7 additions & 0 deletions app/components/App.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
var React = require('react');

function App() {
return <h1>MARIANNE</h1>;
}

module.exports = App;
10 changes: 10 additions & 0 deletions app/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>HAY GURL</title>
</head>
<body>
<div id="app"></div>
</body>
</html>
8 changes: 8 additions & 0 deletions app/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
var React = require('react');
var ReactDOM = require('react-dom');
var App = require('./components/App');

ReactDOM.render(
<App />,
document.getElementById('app')
)
24 changes: 24 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "react-test",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"build" : "webpack",
"start": "webpack-dev-server"
},
"author": "",
"license": "ISC",
"dependencies": {
"react": "^15.5.4",
"react-dom": "^15.5.4"
},
"devDependencies": {
"babel-core": "^6.25.0",
"babel-loader": "^7.0.0",
"babel-preset-react": "^6.24.1",
"html-webpack-plugin": "^2.28.0",
"webpack": "^2.6.1",
"webpack-dev-server": "^2.4.5"
}
}
25 changes: 25 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
var HTMLWebpackPlugin = require('html-webpack-plugin');

var HTMLWebpackPluginConfig = new HTMLWebpackPlugin({
template: __dirname + '/app/index.html',
filename: 'index.html',
inject: 'body'
});

module.exports = {
entry: __dirname + '/app/index.js',
module: {
loaders: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader'
}
]
},
output: {
filename: 'transformed.js',
path: __dirname + '/build'
},
plugins: [HTMLWebpackPluginConfig]
};

0 comments on commit dc20158

Please sign in to comment.