Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export default async ({ production, port, https, target, dontOpenBrowser }) => {
let dev: Function;
const options = {
mode: production ? "production" : "development",
port: parseInt(port, 10) || 3000,
isHttps: !!https,
target: target || "module",
openBrowser: !dontOpenBrowser
};
try {
dev = require("@frontity/core").dev;
} catch (error) {
const message =
`Make sure that you are running ${chalk.green(
"frontity"
)} inside a Frontity project.\n` +
`If so try installing ${chalk.green(
"@frontity/core"
)} again with ${chalk.green("npm i @frontity/core")}.\n`;
errorLogger(error, message);
}
try {
await dev(options);
} catch (error) {
errorLogger(error);
}