Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
exports.webpackDevServer = async function() {
const fp = require('find-free-port');
const webpackConfigFilePath = argv().webpackConfig || 'webpack.serve.config.js';
const configPath = path.resolve(process.cwd(), webpackConfigFilePath);
const port = await fp(4322, 4400);
if (fs.existsSync(configPath)) {
const webpackDevServerPath = require.resolve('webpack-dev-server/bin/webpack-dev-server.js');
const execSync = require('../exec-sync');
const cmd = `node ${webpackDevServerPath} --config ${configPath} --port ${port} --open`;
logger.info(`Caching enabled: ${argv().cached}`);
logger.info('Running: ', cmd);
process.env.cached = argv().cached;
execSync(cmd);
}
};
exports.webpackDevServer = async function() {
const fp = require('find-free-port');
const webpackConfigFilePath = argv().webpackConfig || 'webpack.serve.config.js';
const configPath = path.resolve(process.cwd(), webpackConfigFilePath);
const port = await fp(4322, 4400);
if (fs.existsSync(configPath)) {
const webpackDevServerPath = require.resolve('webpack-dev-server/bin/webpack-dev-server.js');
const execSync = require('../exec-sync');
const cmd = `node ${webpackDevServerPath} --config ${configPath} --port ${port} --open`;
logger.info(`Caching enabled: ${argv().cached}`);
logger.info('Running: ', cmd);
process.env.cached = argv().cached;
execSync(cmd);
}
};