Comments (3)
If you take a look at api docs it's possible to provide additional scripts to pretty page handler. Would that be good enough?
from ouch.
Yeah, I'll just have to find the time to create an error handler for webpack.
from ouch.
=== Update ===
So I've been playing around with Ouch
, and this is the closest thing I can figure to something that works, but it won't for some reason-
var Ouch = require('ouch')
var utils = require('./utils')
var webpack = require('webpack')
var config = require('../config')
var merge = require('webpack-merge')
var baseWebpackConfig = require('./webpack.base.conf')
var HtmlWebpackPlugin = require('html-webpack-plugin')
const { HotModuleReplacementPlugin, DefinePlugin, NoEmitOnErrorsPlugin } = webpack;
// add hot-reload related code to entry chunks
Object.keys(baseWebpackConfig.entry).forEach((name) => (
baseWebpackConfig.entry[name] = ['./build/dev-client'].concat(baseWebpackConfig.entry[name]) ))
module.exports = merge(baseWebpackConfig, {
module: {
rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap })
},
// cheap-module-eval-source-map is faster for development
devtool: '#cheap-module-eval-source-map',
devServer: {
host: '0.0.0.0',
port: 8800,
before(app) {
const ouch = new Ouch();
const { handlers: { PrettyPageHandler }} = Ouch;
const logError = () =>
console.log('Error handled');
app.use((err, req, res, next) => (
ouch.pushHandler(new PrettyPageHandler())
.handleException(err, req, res, logError)));
console.log(instance);
console.log(app);
},
},
plugins: [
new DefinePlugin({
'process.env': config.dev.env
}),
// https://github.com/glenjamin/webpack-hot-middleware#installation--usage
new HotModuleReplacementPlugin(),
new NoEmitOnErrorsPlugin(),
// https://github.com/ampedandwired/html-webpack-plugin
new HtmlWebpackPlugin({
filename: 'index.html',
template: 'index.html',
inject: true
})
]
})
from ouch.
Related Issues (8)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ouch.