function configBuild(options, csp) {
  const result = { ...options };
  const { plugins, output } = result;

  result.plugins = [
    ...(csp ? [replace({ __CSP__: `${csp}`, preventAssignment: true })] : []),
    ...plugins,
    csp ? css({ output: "style.css" }) : css({ inject: true })
  ];

  // modify output file names
  if (csp && output) {
    result.output = (Array.isArray(output) ? output : [output]).map(output => {
      return {
        ...output,
        file: output.file.replace(/^dist\//, "dist/csp/"),
        assetFileNames: "[name][extname]"
      };
    });
  }

  return result;
}
Modifies the Rollup options for a build to support strict CSP
@param {import('rollup').RollupOptions} options the original options
@param {boolean} csp whether to support strict CSP
@returns {import('rollup').RollupOptions} the modified options