cf-devenv
Advanced tools
Comparing version 0.0.2 to 0.0.4
{ | ||
"name": "cf-devenv", | ||
"version": "0.0.2", | ||
"version": "0.0.4", | ||
"description": "calvinfroedge devenv, extracted from redux", | ||
@@ -5,0 +5,0 @@ "main": "server.js", |
@@ -24,6 +24,9 @@ #Overview | ||
``` | ||
var devenv = require('cf-devenv'); | ||
devenv(__dirname); | ||
require('cf-devenv')(__dirname); | ||
``` | ||
When you call `npm start` this will run the dev server. | ||
Your app entry point is `index.js` and you'll need an `index.html` to serve the content from, which should include `index.js` (examples below). | ||
#Boilerplate (gets you started with a page with content, hot reloading) | ||
@@ -30,0 +33,0 @@ |
var webpack = require('webpack'); | ||
var WebpackDevServer = require('webpack-dev-server'); | ||
var config = require('./webpack.config'); | ||
var path = require('path'); | ||
var config = require(path.join(__dirname, 'webpack.config')); | ||
module.exports = function(dir, config){ | ||
var config = config || {}; | ||
var port = config.port || 3000; | ||
module.exports = function(dir, customConfig){ | ||
var customConfig = customConfig || {}; | ||
var port = customConfig.port || 3000; | ||
config.entry.push(path.join(dir, 'index')) | ||
@@ -25,5 +25,4 @@ config.output.path = path.join(dir, 'dist'); | ||
console.log('Listening at localhost:3000'); | ||
console.log('Listening at localhost:'+port); | ||
}); | ||
}; | ||
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
4332
92
1