@cxco/dev-proxy

0.3.0 • Public • Published

Dev-Proxy

To help us develop our Virtual Assistants on the client website by proxying it.

How do I get set up?

npm install @cxco/dev-proxy

Set up in your gulpfile:

    const argv = require('yargs').argv;
	const config = require('./gulp.config')();
    const browserSync = require('browser-sync').create();
	const cxProxyConfig = require('./cx-proxy.config');
    const CxProxy = require('@cxco/dev-proxy').default;

	// ... other gulp tasks and requires

    // serve and watch files
    gulp.task('watch', ['build'], async () => {
        let port
        let browserSyncConfig = {};

        if (proxy) {
            port = await (new CxProxy(cxProxyConfig)).start();
            browserSyncConfig.proxy = `localhost:${port}`;
        } else {
            browserSyncConfig.server = {
                baseDir: `./${config.build}`
            }
        }

        browserSync.init(browserSyncConfig);

        gulp.watch(config.watch, ['bs-reload']);
        gulp.watch(config.scss, () => buildCss(true));
    });

Configuration

To use the Dev-Proxy in your project you will also need a configuration file. You can use the cx-proxy.config.example file to start with.

Publishing

Increment version with npm version [<newversion> | major | minor | patch | premajor | preminor | prepatch | prerelease | from-git]

To publish this package to NPMJS.com run npm publish with an authenticated user.

Readme

Keywords

none

Package Sidebar

Install

npm i @cxco/dev-proxy

Weekly Downloads

1

Version

0.3.0

License

ISC

Unpacked Size

41 kB

Total Files

39

Last publish

Collaborators

  • bo.strijker
  • cx-company
  • remcodevries