0.3.1 • Published 4 years ago

@web/test-runner-dev-server v0.3.1

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

Test Runner Dev Server

Server for serving test files, based on es-dev-server.

See @web/test-runner for a default implementation and CLI for the test runner.

The dev server has a lot of configuration options and a plugin system. Check out the es-dev-server docs for all possible options.

If you're using @web/test-runner, you can configure the dev server from the configuration file. For example:

import proxy from 'koa-proxies';
import awesomePlugin from 'awesome-plugin';

export default {
  devServer: {
    rootDir: '../..',
    moduleDirs: ['node_modules', 'fancy_modules'],
    middlewares: [
      proxy('/api', {
        target: 'http://localhost:9001',
      }),
    ],
    plugins: [
      // use a plugin
      awesomePlugin({ someOption: 'someProperty' }),
      // create an inline plugin
      {
        transform(context) {
          if (context.path === '/src/environment.js') {
            return { body: `export const version = '${packageJson.version}';` };
          }
        },
      },
    ],
  },
};