How to use the react-cosmos/dist/server/web/webpack/default-webpack-config function in react-cosmos

To help you get started, we’ve selected a few react-cosmos 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 skidding / jobs-done / tools / shared / webpack / webpackConfig.js View on Github external
export function getAppWebpackConfig({ path, filename, mode }) {
  // XXX: This is an experiment to see what would a Cosmos API for building
  // an app bundle would look like
  const { rootPath, globalImports } = getCosmosConfig(COSMOS_CONFIG_PATH);
  const defaultWebpackConfig = getDefaultWebpackConfig(rootPath);

  let webpackConfig = {
    ...defaultWebpackConfig,
    mode,
    devtool: mode === 'production' ? false : defaultWebpackConfig.devtool,
    entry: [...globalImports, require.resolve('../../../App.dom')],
    output: {
      path,
      filename,
      publicPath: '/'
    }
  };

  // XXX: Omit HtmlWebpackPlugin used in renderer build
  webpackConfig = {
    ...webpackConfig,

react-cosmos

Sandbox for developing and testing UI components in isolation

MIT
Latest version published 2 months ago

Package Health Score

67 / 100
Full package analysis