Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function runWebpack(done) {
// https://webpack.github.io/docs/webpack-dev-server.html
let opts = {
host: 'localhost',
publicPath: config.output.publicPath,
filename: config.output.filename,
hot: project.platform.hmr || CLIOptions.hasFlag('hmr'),
port: CLIOptions.getFlagValue('port') || project.platform.port,
contentBase: config.output.path,
historyApiFallback: true,
open: project.platform.open || CLIOptions.hasFlag('open'),
stats: {
colors: require('supports-color')
},
...config.devServer
};
// Add the webpack-dev-server client to the webpack entry point
// The path for the client to use such as `webpack-dev-server/client?http://${opts.host}:${opts.port}/` is not required
// The path used is derived from window.location in the browser and output.publicPath in the webpack.config.
if (project.platform.hmr || CLIOptions.hasFlag('hmr')) {
config.plugins.push(new webpack.HotModuleReplacementPlugin());
config.entry.app.unshift('webpack-dev-server/client', 'webpack/hot/dev-server');
} else {
let serve = gulp.series(build, done => {
bs.init(
{
online: false,
open: CLIOptions.hasFlag('open') || project.platform.open,
port: CLIOptions.getFlagValue('port') || project.platform.port,
host:
CLIOptions.getFlagValue('host') || project.platform.host || 'localhost',
logLevel: 'silent',
server: {
baseDir: [project.platform.baseDir],
middleware: [
historyApiFallback(),
function (req, res, next) {
res.setHeader('Access-Control-Allow-Origin', '*')
next()
},
],
},
},
function (err, bs) {
if (err) return done(err)
let urls = bs.options.get('urls').toJS()
let host = bs.options.get('host')
let serve = gulp.series(build, done => {
bs.init(
{
online: false,
open: CLIOptions.hasFlag('open') || project.platform.open,
port: CLIOptions.getFlagValue('port') || project.platform.port,
host:
CLIOptions.getFlagValue('host') || project.platform.host || 'localhost',
logLevel: 'silent',
server: {
baseDir: [project.platform.baseDir],
middleware: [
historyApiFallback(),
function (req, res, next) {
res.setHeader('Access-Control-Allow-Origin', '*')
next()
},
],
},
},
function (err, bs) {
if (err) return done(err)
done => {
browserSync({
online: false,
open: CLIOptions.hasFlag('open'),
port: CLIOptions.getFlagValue('port') || project.platform.port,
logLevel: 'silent',
server: {
baseDir: [project.platform.baseDir],
middleware: [historyApiFallback(), function(req, res, next) {
res.setHeader('Access-Control-Allow-Origin', '*');
next();
}]
}
}, function (err, bs) {
if (err) return done(err);
let urls = bs.options.get('urls').toJS();
log(`Application Available At: ${urls.local}`);
log(`BrowserSync Available At: ${urls.ui}`);
done();
});
}
const CLIOptions = require( 'aurelia-cli').CLIOptions;
const aureliaConfig = require('./aurelia_project/aurelia.json');
const PORT = CLIOptions.getFlagValue('port') || aureliaConfig.platform.port;
const HOST = CLIOptions.getFlagValue('host') || aureliaConfig.platform.host;
module.exports = {
config: {
baseUrl: `http://${HOST}:${PORT}`,
fixturesFolder: 'test/e2e/fixtures',
integrationFolder: 'test/e2e/integration',
pluginsFile: 'test/e2e/plugins/index.js',
screenshotsFolder: 'test/e2e/screenshots',
supportFile: 'test/e2e/support/index.js',
videosFolder: 'test/e2e/videos'
}
};
done => {
browserSync({
online: false,
open: CLIOptions.hasFlag('open'),
port: CLIOptions.getFlagValue('port') || project.platform.port,
logLevel: 'silent',
server: {
baseDir: [project.platform.baseDir],
middleware: [historyApiFallback(), function(req, res, next) {
res.setHeader('Access-Control-Allow-Origin', '*');
next();
}]
}
}, function (err, bs) {
if (err) return done(err);
let urls = bs.options.get('urls').toJS();
log(`Application Available At: ${urls.local}`);
log(`BrowserSync Available At: ${urls.ui}`);
done();
});
}
const CLIOptions = require( 'aurelia-cli').CLIOptions;
const aureliaConfig = require('./aurelia_project/aurelia.json');
const PORT = CLIOptions.getFlagValue('port') || aureliaConfig.platform.port;
const HOST = CLIOptions.getFlagValue('host') || aureliaConfig.platform.host;
module.exports = {
config: {
baseUrl: `http://${HOST}:${PORT}`,
fixturesFolder: 'test/e2e/fixtures',
integrationFolder: 'test/e2e/integration',
pluginsFile: 'test/e2e/plugins/index.js',
screenshotsFolder: 'test/e2e/screenshots',
supportFile: 'test/e2e/support/index.js',
videosFolder: 'test/e2e/videos'
}
};