Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hot-reload-server

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hot-reload-server - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

75

hot-reload-server.js

@@ -13,45 +13,50 @@ 'use strict'

// Create the webpack compiler
const webpackCompiler = webpack(webpackConfig)
// Create the webpack compiler
const webpackCompiler = webpack(webpackConfig)
// Create the hot reload server
let app = express()
// Create the hot reload server
let app = express()
// Set the address/port
webpackConfig.hotReloadServer = Object.assign({}, {
address: 'localhost',
port: 4000
}, webpackConfig.hotReloadServer)
// Set the address/port
webpackConfig.hotReloadServer = Object.assign({}, {
address: 'localhost',
port: 4000
}, webpackConfig.hotReloadServer)
// Set the default webpack-dev-middleware configs
let defaults = {
noInfo: true,
watchOptions: {
aggregateTimeout: 1000,
poll: 1000
}
}
// Set the default webpack-dev-middleware configs
let defaults = {
noInfo: true,
watchOptions: {
aggregateTimeout: 1000,
poll: 1000
}
}
return {
start: function() {
// Override webpack-dev-middleware configs
devMiddlewareConfig = Object.assign({}, defaults, devMiddlewareConfig)
return {
// starts the hot-reload-server
start: function() {
// Override webpack-dev-middleware configs
devMiddlewareConfig = Object.assign({}, defaults, devMiddlewareConfig)
// Attach webpack-dev-middleware and webpack-hot-middleware
app.use(webpackDevMiddleware(webpackCompiler, devMiddlewareConfig))
app.use(webpackHotMiddleware(webpackCompiler))
// Attach webpack-dev-middleware and webpack-hot-middleware
app.use(webpackDevMiddleware(webpackCompiler, devMiddlewareConfig))
app.use(webpackHotMiddleware(webpackCompiler))
// Create static directories
app.use(path.basename(webpackConfig.output.path), express.static(webpackConfig.output.path))
// Create static directories
app.use(path.basename(webpackConfig.output.path), express.static(webpackConfig.output.path))
// Listen to the port
let server = app.listen(webpackConfig.hotReloadServer.port, function(err, result) {
if (err) {
console.log(err)
}
console.log('hot-reload-server running on http://%s:%s', webpackConfig.hotReloadServer.address, webpackConfig.hotReloadServer.port)
})
}
}
// Listen to the port
let server = app.listen(webpackConfig.hotReloadServer.port, function(err, result) {
if (err) {
console.log(err)
}
console.log('hot-reload-server running on http://%s:%s', webpackConfig.hotReloadServer.address, webpackConfig.hotReloadServer.port)
})
},
// retrieves the express app instance
get: function() {
return app
}
}
}
{
"name": "hot-reload-server",
"version": "0.0.2",
"version": "0.0.3",
"description": "",

@@ -5,0 +5,0 @@ "main": "hot-reload-server.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc