Last active
June 27, 2017 13:12
-
-
Save Losses/3cc49d61f325a4d2e43dd0f3f3676792 to your computer and use it in GitHub Desktop.
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
import React from 'react' | |
import { Link } from 'react-router-dom' | |
import fileLoader from 'file-loader' | |
class HeaderBar extends React.Component { | |
constructor(props) { | |
super(props) | |
} | |
render() { | |
return ( | |
<header className="header_bar"> | |
<div className="logo"> | |
<img src={require('./images/logo.svg')} alt="logo" /> | |
</div> | |
<nav className="top_nav"> | |
<Link to="/">Members</Link> | |
<Link to="/">Researches</Link> | |
<Link to="/">Papers</Link> | |
<Link to="/">Contact</Link> | |
</nav> | |
</header> | |
) | |
} | |
} | |
export default HeaderBar |
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
'use strict'; | |
const path = require('path'); | |
const webpack = require('webpack'); | |
const fs = require('fs'); | |
const nodeExternals = require('webpack-node-externals'); | |
const deploymentPath = path.join(__dirname, 'deployment'); | |
const commonLoaders = [ | |
{ | |
test: /\.(js|jsx)$/, | |
loader: 'babel-loader', | |
query: { | |
presets: ['react', 'es2015'] | |
} | |
}, | |
{ | |
test: /\.less$/, | |
loaders: ['style', 'css', 'less'], | |
include: path.resolve(__dirname, 'app') | |
}, | |
{ | |
test: /\.(png|jpg|gif)$/, | |
loader: 'url-loader?limit=8192&name=./assets/[hash].[ext]' | |
}, | |
{ | |
test: /\.svg$/, | |
loader: 'file-loader?name=./assets/[hash].[ext]' | |
} | |
] | |
const commonResolve = { | |
extensions: ['.js', '.jsx', '.json'] | |
} | |
module.exports = [{ | |
name: 'browser', | |
entry: path.join(__dirname, 'app', 'source', 'entry.jsx'), | |
output: { | |
path: deploymentPath, | |
filename: 'assets/bundle.js' | |
}, | |
devtool: "source-map", | |
resolve: commonResolve, | |
module: { | |
loaders: commonLoaders | |
}, | |
plugins: [ | |
/* | |
new webpack.DefinePlugin({ | |
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV) | |
}), | |
new webpack.optimize.OccurrenceOrderPlugin(), | |
new webpack.optimize.UglifyJsPlugin({ | |
compress: { warnings: false }, | |
output: { comments: false }, | |
mangle: true, | |
sourceMap: true, | |
beautify: false, | |
dead_code: true | |
}) | |
*/ | |
], | |
}, | |
{ | |
name: 'server', | |
entry: path.join(__dirname, 'server', 'server.jsx'), | |
output: { | |
path: deploymentPath, | |
filename: 'server.js' | |
}, | |
target: 'node', | |
node: { | |
console: false, | |
global: false, | |
process: false, | |
Buffer: false, | |
__filename: false, | |
__dirname: false | |
}, | |
externals: [nodeExternals()], | |
resolve: commonResolve, | |
module: { | |
loaders: commonLoaders | |
} | |
} | |
]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment