Initial react commit
This commit is contained in:
11
.babelrc
Normal file
11
.babelrc
Normal file
@ -0,0 +1,11 @@
|
||||
{
|
||||
"presets": [
|
||||
["env", {
|
||||
"targets": {
|
||||
"node": "current"
|
||||
}
|
||||
}],
|
||||
"react",
|
||||
"babel-polyfill"
|
||||
]
|
||||
}
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -57,3 +57,5 @@ typings/
|
||||
# dotenv environment variables file
|
||||
.env
|
||||
|
||||
dist/
|
||||
/package-lock.json
|
||||
|
46
package.json
Normal file
46
package.json
Normal file
@ -0,0 +1,46 @@
|
||||
{
|
||||
"name": "domsplace",
|
||||
"version": "5.0.0",
|
||||
"description": "Personal website for Dominic \"YouWish\" Masters.",
|
||||
"main": "private/index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/YourWishes/domsPlaceNew.git"
|
||||
},
|
||||
"keywords": [
|
||||
"domsplace",
|
||||
"personal",
|
||||
"portfolio",
|
||||
"website"
|
||||
],
|
||||
"author": "Dominic Masters",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/YourWishes/domsPlaceNew/issues"
|
||||
},
|
||||
"homepage": "https://github.com/YourWishes/domsPlaceNew#readme",
|
||||
"dependencies": {
|
||||
"express": "^4.16.2",
|
||||
"mysql-promise": "^4.1.0",
|
||||
"react": "^16.2.0",
|
||||
"react-dom": "^16.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel-cli": "^6.26.0",
|
||||
"babel-loader": "^7.1.2",
|
||||
"babel-polyfill": "^6.26.0",
|
||||
"babel-preset-env": "^1.6.1",
|
||||
"babel-preset-react": "^6.24.1",
|
||||
"css-loader": "^0.28.10",
|
||||
"html-webpack-plugin": "^2.30.1",
|
||||
"jest": "^22.4.0",
|
||||
"node-sass": "^4.7.2",
|
||||
"sass-loader": "^6.0.6",
|
||||
"style-loader": "^0.20.2",
|
||||
"webpack": "^3.11.0",
|
||||
"webpack-dev-server": "^2.11.1"
|
||||
}
|
||||
}
|
17
public/App.jsx
Normal file
17
public/App.jsx
Normal file
@ -0,0 +1,17 @@
|
||||
import React from 'react';
|
||||
|
||||
class App extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div className="c-app">
|
||||
App
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
export default App;
|
11
public/index.html
Normal file
11
public/index.html
Normal file
@ -0,0 +1,11 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html lang="en-AU" class="no-js">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>domsPlace</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
</body>
|
||||
</html>
|
13
public/index.jsx
Normal file
13
public/index.jsx
Normal file
@ -0,0 +1,13 @@
|
||||
'use strict';
|
||||
|
||||
import 'babel-polyfill';
|
||||
|
||||
import React from 'react';
|
||||
import ReactDOM, { render } from 'react-dom';
|
||||
|
||||
import App from './App.jsx';
|
||||
import Styles from './styles/index.scss';
|
||||
|
||||
render((
|
||||
<App />
|
||||
), document.getElementById("app"));
|
1
public/styles/index.scss
Normal file
1
public/styles/index.scss
Normal file
@ -0,0 +1 @@
|
||||
@charset "UTF-8";
|
65
webpack.config.js
Normal file
65
webpack.config.js
Normal file
@ -0,0 +1,65 @@
|
||||
const
|
||||
webpack = require('webpack'),
|
||||
HtmlWebpackPlugin = require('html-webpack-plugin')
|
||||
;
|
||||
|
||||
const HTMLWebpackPluginConfig = new HtmlWebpackPlugin({
|
||||
template: __dirname + '/public/index.html',
|
||||
filename: 'index.html',
|
||||
inject: 'body'
|
||||
});
|
||||
|
||||
// export webpack config
|
||||
module.exports = {
|
||||
devtool: 'cheap-module-eval-source-map',
|
||||
entry: [
|
||||
'./public/index.jsx'
|
||||
],
|
||||
|
||||
output: {
|
||||
path: __dirname + '/dist',
|
||||
filename: "app.js"
|
||||
},
|
||||
|
||||
resolve: {
|
||||
modules: ['node_modules', './public'],
|
||||
extensions: ['.js', '.jsx', '.css', '.scss' ]
|
||||
},
|
||||
|
||||
// declare loaders to be used in webpack
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.jsx?$/,
|
||||
exclude: /node_modules/,
|
||||
loaders: ['babel-loader']
|
||||
},
|
||||
|
||||
{
|
||||
test: /\.scss$|\.css$/i,
|
||||
loaders: ["style-loader", "css-loader", "sass-loader"]
|
||||
},
|
||||
|
||||
{
|
||||
test: /\.jpe?g$|\.gif$|\.png$|\.svg$/i,
|
||||
loader: "file-loader?name=[path][name].[ext]"
|
||||
},
|
||||
|
||||
{
|
||||
test: /\.(eot|ttf|woff(2)?)(\?v=\d+\.\d+\.\d+)?/,
|
||||
loader: 'url-loader'
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
// initialize the added webpack plugins
|
||||
plugins: [
|
||||
new webpack.DefinePlugin({
|
||||
'process.env': {
|
||||
NODE_ENV: JSON.stringify('development')
|
||||
}
|
||||
}),
|
||||
HTMLWebpackPluginConfig,
|
||||
new webpack.HotModuleReplacementPlugin()
|
||||
]
|
||||
};
|
Reference in New Issue
Block a user