Created
May 6, 2016 16:34
-
-
Save czbaker/a34b44a4e752d8ddb0e1b5267b8463cb 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 express from 'express'; | |
| import webpackDevMiddleware from 'webpack-dev-middleware' | |
| import webpackHotMiddleware from 'webpack-hot-middleware' | |
| import webpack from 'webpack' | |
| import webpackConfig from '../webpack.config' | |
| const devCompiler = webpack(webpackConfig) | |
| const app = express(); | |
| app.use(webpackDevMiddleware(devCompiler)) | |
| app.use(webpackHotMiddleware(devCompiler)) | |
| app.listen(3000, () => { | |
| console.log("App started on port 3000!"); | |
| }) |
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 path from 'path' | |
| import HtmlWebpackPlugin from 'html-webpack-plugin' | |
| import babel from 'babel-loader' | |
| import webpack from 'webpack' | |
| console.log("Loading development webpack configuration...") | |
| module.exports = {a | |
| devtool: "sourcemap", | |
| entry: [ | |
| 'webpack-hot-middleware?reload=true', | |
| './client/index.js' | |
| ], | |
| output: { | |
| path: '/', | |
| publicPath: '/', | |
| filename: 'bundle.js' | |
| }, | |
| module: { | |
| loaders: [ | |
| { test: /\.css$/, exclude: /\.useable\.css$/, loader: "style!css" }, | |
| { test: /\.useable\.css$/, loader: "style/useable!css" }, | |
| { | |
| test: /\.jsx?$/, | |
| exclude: /(node_modules)|(bower_components)/, | |
| loader: 'babel', | |
| query: { | |
| presets: ['es2015', 'react'] | |
| } | |
| } | |
| ] | |
| }, | |
| plugins: [ | |
| new HtmlWebpackPlugin({ | |
| title: 'Perseus', | |
| template: './client/index.html' | |
| }), | |
| new webpack.optimize.OccurenceOrderPlugin(), | |
| new webpack.HotModuleReplacementPlugin(), | |
| new webpack.NoErrorsPlugin() | |
| ] | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment