cleanup (structure): update code structure

This commit is contained in:
Mickael KERJEAN
2017-06-27 17:50:27 +10:00
parent 58de01a16c
commit 0b5137846c
49 changed files with 4 additions and 7 deletions

View File

@ -1,4 +1,3 @@
// src/app-client.js
import React from 'react'; import React from 'react';
import ReactDOM from 'react-dom'; import ReactDOM from 'react-dom';
import Router from './router'; import Router from './router';

View File

@ -2,12 +2,10 @@ const webpack = require('webpack');
const path = require('path'); const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin'); const HtmlWebpackPlugin = require('html-webpack-plugin');
let config = { let config = {
entry: [ entry: [
'babel-polyfill', 'babel-polyfill',
path.join(__dirname, 'src', 'client.js') path.join(__dirname, 'client', 'index.js')
], ],
output: { output: {
path: path.join(__dirname, 'server', 'public'), path: path.join(__dirname, 'server', 'public'),
@ -17,7 +15,7 @@ let config = {
module: { module: {
loaders: [ loaders: [
{ {
test: path.join(__dirname, 'src'), test: path.join(__dirname, 'client'),
loader: ['babel-loader'] loader: ['babel-loader']
}, },
{ {
@ -32,7 +30,7 @@ let config = {
}), }),
new webpack.optimize.OccurrenceOrderPlugin(), new webpack.optimize.OccurrenceOrderPlugin(),
new HtmlWebpackPlugin({ new HtmlWebpackPlugin({
template: __dirname + '/src/index.html', template: path.join(__dirname, 'client', 'index.html'),
inject:true inject:true
}) })
] ]
@ -57,7 +55,7 @@ if(process.env.NODE_ENV === 'production'){
} }
} }
}; };
config.entry.push('webpack/hot/only-dev-server'); //config.entry.push('webpack/hot/only-dev-server');
} }