How to use the af-webpack/dev.default function in af-webpack

To help you get started, we’ve selected a few af-webpack examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github umijs / umi / packages / umi-build-dev / src / plugins / commands / dev / index.js View on Github external
.then(() => {
                debug('start dev server with af-webpack/dev');
                const { history = 'browser' } = service.config;
                require('af-webpack/dev').default({
                  cwd,
                  port,
                  history: typeof history === 'string' ? history : history[0],
                  base: service.config.base,
                  webpackConfig: service.webpackConfig,
                  proxy: service.config.proxy || {},
                  contentBase: './path-do-not-exists',
                  _beforeServerWithApp(app) {
                    // @private
                    service.applyPlugins('_beforeServerWithApp', { args: { app } });
                  },
                  beforeMiddlewares: service.applyPlugins('addMiddlewareAhead', {
                    initialValue: [
                      ...(service.ssrWebpackConfig
                        ? [
                            require('af-webpack/webpack-dev-middleware')(