<commit_before>import commonjs from 'rollup-plugin-commonjs';
import json from 'rollup-plugin-json';
import nodeResolve from 'rollup-plugin-node-resolve';
import sourcemaps from 'rollup-plugin-sourcemaps';

export default {
  input: 'build/src/index.js',
  output: {
    file: 'build/vega-lite.js',
    format: 'umd',
    sourcemap: true,
    name: 'vl'
  },
  plugins: [nodeResolve({browser: true}), commonjs(), json(), sourcemaps()]
};<commit_msg>Throw an error when we import util or vega (#4692)<commit_after>import commonjs from 'rollup-plugin-commonjs';
import json from 'rollup-plugin-json';
import nodeResolve from 'rollup-plugin-node-resolve';
import sourcemaps from 'rollup-plugin-sourcemaps';

export function disallowedImports() {
  return {
    resolveId: module => {
      if (module === 'vega' || module === 'util') {
        throw new Error('Cannot import from Vega or Node Util in Vega-Lite.');
      }
      return null;
    }
  };
}

export default {
  input: 'build/src/index.js',
  output: {
    file: 'build/vega-lite.js',
    format: 'umd',
    sourcemap: true,
    name: 'vl'
  },
  plugins: [disallowedImports(), nodeResolve({browser: true}), commonjs(), json(), sourcemaps()]
};
{'fraction_non_alphanumeric': 0.15282392026578073, 'fraction_numerical': 0.0033222591362126247, 'mean_word_length': 3.9385245901639343, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3693471', 'n_tokens_mistral': 391, 'n_tokens_neox': 392, 'n_words': 104}