Commit 79c09338 authored by Jure's avatar Jure

Initial commit

parents
.DS_Store
node_modules/
import React from 'react'
import configureStore from './store/configureStore'
import { render } from 'react-dom'
import Root from './containers/Root'
let store = configureStore()
render(
<Root store={store} />,
document.getElementById('root')
)
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title><%= htmlWebpackPlugin.options.title %></title>
</head>
<body>
<div id="root"></div>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<div id="root"></div>
<script type="text/javascript" charset="utf-8" src="/assets/app.js"></script>
</body>
</html>
import React from 'react'
import { Route } from 'react-router'
import { requireAuthentication } from './containers/AuthenticatedComponent'
// Manage
import Manage from './containers/Manage'
import PostsManager from './containers/PostsManager'
import Editor from './containers/EditorWrapper'
import UsersManager from './containers/UsersManager'
// Public
import Blog from './containers/Blog'
import Blogpost from './containers/BlogpostWrapper'
// Authentication
import Login from './components/Login'
import Signup from './components/Signup'
export default (
<Route>
<Route path='/' component={Blog}/>
<Route path='/manage' component={requireAuthentication(Manage)}>
<Route path='posts' component={PostsManager} />
<Route path='editor/:id' component={Editor} />
<Route path='users' component={UsersManager} />
</Route>
<Route path='/login' component={Login} />
<Route path='/signup' component={Signup} />
<Route path='/:id' component={Blogpost}/>
</Route>
)
module.exports = {
secret: 'EXAMPLEDONTUSE',
API_ENDPOINT: '/api',
editor: '../registry/Substance/Writer.jsx',
// editor: '../registry/Quill/Editor.jsx',
reader: '../registry/Substance/Reader.jsx',
// reader: '../registry/Quill/Reader.jsx'
theme: 'pepper'
}
{
"name": "science-blogger",
"version": "1.0.0-alpha",
"private": true,
"scripts": {
"setup": "node api/setup.js",
"build": "webpack --colors --config ./webpack/webpack.prod.config.js",
"start": "PORT=80 NODE_ENV=production node bin/www",
"dev": "NODE_ENV=dev LOADER=hot node bin/www",
"pouchdb": "./node_modules/pouchdb-server/bin/pouchdb-server --level-prefix=./api/db/ -d ./api/db/",
"test": "NODE_ENV=test ./node_modules/.bin/mocha --harmony api/test/*.js -R nyan",
"eslint": "eslint"
},
"dependencies": {
"core": "git+https://gitlab.coko.foundation/pubsweet/core.git#master"
},
"standard": {
"parser": "babel-eslint"
}
}
var path = require('path')
var webpack = require('webpack')
var config = require('../config')
var ThemeResolver = require('./ThemeResolver')
var assetsPath = path.join(__dirname, '..', 'public', 'assets')
var publicPath = '/assets/'
// We're including JSX components from our components package,
// but excluding its node_modules.
var commonLoaders = [
{
/*
* TC39 categorises proposals for babel in 4 stages
* Read more http://babeljs.io/docs/usage/experimental/
*/
test: /\.js$|\.jsx$/,
loader: 'babel',
// Reason why we put this here instead of babelrc
// https://github.com/gaearon/react-transform-hmr/issues/5#issuecomment-142313637
query: {
'presets': ['react-hmre', 'es2015', 'react'],
'cacheDirectory': true
},
include: path.join(__dirname, '..', 'app'),
exclude: path.join(__dirname, '/node_modules/')
},
{ test: /\.png$/, loader: 'url-loader' },
{
test: /\.woff|\.woff2|\.svg|.eot|\.ttf/,
loader: 'url?prefix=font/&limit=10000'
},
{ test: /\.html$/, loader: 'html-loader' },
{ test: /\.json$/, loader: 'json-loader' },
{ test: /\.css$|\.scss$/,
exclude: /\.local\.s?css$/, // Exclude local styles from global
loader: 'style-loader!css-loader!sass-loader'
},
{ test: /\.css$|\.scss$/,
include: /\.local\.s?css/, // Local styles
loader: 'style-loader!css-loader?modules&importLoaders=1!sass-loader'
}
]
module.exports = [
{
// The configuration for the client
name: 'app',
target: 'web',
context: path.join(__dirname, '..', 'app'),
entry: {
app: [
'./app',
'webpack-hot-middleware/client?path=/__webpack_hmr&timeout=20000&reload=true'
]
},
output: {
// The output directory as absolute path
path: assetsPath,
// The filename of the entry chunk as relative path inside the output.path directory
filename: '[name].js',
// The output path from the view of the Javascript
publicPath: publicPath
},
devtool: 'inline-source-map',
module: {
preLoaders: [{
test: /\.js$|\.jsx$/,
exclude: [/\/node_modules/, /\/lens/, /\/substance/],
loaders: ['eslint-loader']
}],
loaders: commonLoaders
},
resolve: {
extensions: ['', '.js', '.jsx', '.json', '.scss'],
alias: {
'editor$': config.editor,
'reader$': config.reader
}
},
plugins: [
new webpack.ResolverPlugin([ThemeResolver], ['normal', 'context', 'loader']),
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('dev')
}),
new webpack.HotModuleReplacementPlugin(),
// new ExtractTextPlugin('styles.css'),
new webpack.NoErrorsPlugin()
],
node: {
fs: 'empty'
}
}
]
var path = require('path')
var webpack = require('webpack')
var ExtractTextPlugin = require('extract-text-webpack-plugin')
var HtmlWebpackPlugin = require('html-webpack-plugin')
var ThemeResolver = require('./ThemeResolver')
var config = require('../config')
var assetsPath = path.join(__dirname, '..', 'public', 'assets')
var publicPath = '/assets/'
// We're including JSX components from our components package,
// but excluding its node_modules.
var commonLoaders = [
{
/*
* TC39 categorises proposals for babel in 4 stages
* Read more http://babeljs.io/docs/usage/experimental/
*/
test: /\.js$|\.jsx$/,
loader: 'babel',
// Reason why we put this here instead of babelrc
// https://github.com/gaearon/react-transform-hmr/issues/5#issuecomment-142313637
query: {
'presets': ['es2015', 'react'],
'cacheDirectory': true
},
include: path.join(__dirname, '..', 'app'),
exclude: path.join(__dirname, '/node_modules/')
},
{ test: /\.png$/, loader: 'url-loader' },
{
test: /\.woff|\.woff2|\.svg|.eot|\.ttf/,
loader: 'url?prefix=font/&limit=10000'
},
{ test: /\.html$/, loader: 'html-loader' },
{ test: /\.json$/, loader: 'json-loader' },
{ test: /\.css$|\.scss$/,
exclude: /\.local\.s?css$/, // Exclude local styles from global
loader: 'style-loader!css-loader!sass-loader'
},
{ test: /\.css$|\.scss$/,
include: /\.local\.s?css/, // Local styles
loader: 'style-loader!css-loader?modules&importLoaders=1!sass-loader'
}
]
module.exports = [
{
// The configuration for the client
name: 'app',
target: 'web',
context: path.join(__dirname, '..', 'app'),
entry: {
app: [ './app' ]
},
output: {
// The output directory as absolute path
path: assetsPath,
// The filename of the entry chunk as relative path inside the output.path directory
filename: '[name]-[hash].js',
// The output path from the view of the Javascript
publicPath: publicPath
},
module: {
preLoaders: [{
test: /\.js$|\.jsx$/,
exclude: [/node_modules/, /\/lens/, /\/substance/],
loaders: ['eslint-loader']
}],
loaders: commonLoaders
},
resolve: {
extensions: ['', '.js', '.jsx', '.json', '.scss'],
alias: {
'editor$': config.editor,
'reader$': config.reader
}
},
plugins: [
new webpack.ResolverPlugin([ThemeResolver], ['normal', 'context', 'loader']),
new HtmlWebpackPlugin({
title: 'PubSweet',
template: '../app/index.ejs', // Load a custom template
inject: 'body' // Inject all scripts into the body
}),
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('production')
}),
new ExtractTextPlugin('styles/main.css'),
new webpack.optimize.UglifyJsPlugin(),
new webpack.NoErrorsPlugin()
],
node: {
fs: 'empty'
}
}
]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment