Skip to content

Commit ce34619

Browse files
committed
initial import
0 parents  commit ce34619

File tree

7 files changed

+6584
-0
lines changed

7 files changed

+6584
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
dist

package.json

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
{
2+
"name": "inkblot-comments",
3+
"version": "1.0.0",
4+
"description": "",
5+
"main": "index.js",
6+
"keywords": [
7+
"inkblot",
8+
"firebase",
9+
"react",
10+
"comments"
11+
],
12+
"scripts": {
13+
"precommit": "lint-staged",
14+
"test": "jest",
15+
"start": "webpack-dev-server --open",
16+
"build": "NODE_ENV='production' webpack -p",
17+
"format": "prettier-standard 'src/**/*.js'",
18+
"styleguide": "styleguidist server",
19+
"styleguide:build": "styleguidist build"
20+
},
21+
"lint-staged": {
22+
"linters": {
23+
"src/**/*.js": [
24+
"prettier-standard",
25+
"git add",
26+
"jest --bail --findRelatedTests"
27+
]
28+
}
29+
},
30+
"babel": {
31+
"presets": [
32+
[
33+
"env",
34+
{
35+
"targets": {
36+
"browsers": [
37+
"last 2 versions",
38+
"safari >= 10",
39+
"ie >= 11"
40+
],
41+
"modules": false,
42+
"loose": false
43+
}
44+
}
45+
],
46+
"react"
47+
]
48+
},
49+
"author": "Niilo Ursin, @niiloursin",
50+
"license": "MIT",
51+
"dependencies": {
52+
"preact": "^8.1.0",
53+
"preact-compat": "^3.16.0",
54+
"query-string": "^4.3.4",
55+
"react": "^15.5.4",
56+
"react-dom": "^15.5.4",
57+
"react-router-dom": "^4.1.1",
58+
"unfetch": "^2.1.2"
59+
},
60+
"devDependencies": {
61+
"babel-core": "^6.24.1",
62+
"babel-loader": "^7.0.0",
63+
"babel-preset-env": "^1.4.0",
64+
"babel-preset-react": "^6.24.1",
65+
"css-loader": "^0.28.1",
66+
"enzyme": "^2.8.2",
67+
"html-webpack-plugin": "^2.28.0",
68+
"husky": "^0.13.3",
69+
"jest": "^19.0.2",
70+
"lint-staged": "^3.4.1",
71+
"prettier-standard": "^5.0.0",
72+
"react-styleguidist": "^5.1.9",
73+
"style-loader": "^0.17.0",
74+
"webpack": "^2.5.0",
75+
"webpack-dev-server": "^2.4.5"
76+
}
77+
}

public/index.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!doctype html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="utf-8">
6+
<meta name="viewport" content="width=device-width, initial-scale=1">
7+
<title>React App</title>
8+
</head>
9+
10+
<body>
11+
<div id="app"></div>
12+
</body>
13+
14+
</html>

src/components/App.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import React from 'react'
2+
3+
export default () => <div>Hello from react</div>

src/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import React from 'react'
2+
import ReactDOM from 'react-dom'
3+
import App from './components/App'
4+
5+
ReactDOM.render(<App />, document.getElementById('app'))

webpack.config.js

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
var path = require('path')
2+
var HtmlWebPackPlugin = require('html-webpack-plugin')
3+
var webpack = require('webpack')
4+
5+
var config = {
6+
entry: './src/index.js',
7+
output: {
8+
path: path.resolve(__dirname, 'dist'),
9+
filename: 'index_bundle.js',
10+
publicPath: '/'
11+
},
12+
resolve: {
13+
alias: {
14+
react: 'preact-compat',
15+
'react-dom': 'preact-compat'
16+
}
17+
},
18+
module: {
19+
rules: [
20+
{
21+
test: /\.(js)$/,
22+
use: 'babel-loader',
23+
include: [
24+
path.resolve('src'),
25+
path.resolve('node_modules/preact-compat/src')
26+
]
27+
},
28+
{
29+
test: /\.(css)$/,
30+
use: [
31+
'style-loader',
32+
{
33+
loader: 'css-loader',
34+
options: {
35+
url: false
36+
}
37+
}
38+
]
39+
}
40+
]
41+
},
42+
devServer: {
43+
historyApiFallback: true
44+
},
45+
plugins: [
46+
new HtmlWebPackPlugin({
47+
template: 'public/index.html'
48+
})
49+
]
50+
}
51+
52+
if (process.env.NODE_ENV === 'production') {
53+
config.plugins.push(
54+
new webpack.DefinePlugin({
55+
'process.env': {
56+
NODE_ENV: JSON.stringify(process.env.NODE_ENV)
57+
}
58+
}),
59+
new webpack.optimize.UglifyJsPlugin()
60+
)
61+
}
62+
63+
module.exports = config

0 commit comments

Comments
 (0)