const gulp = require('gulp');
const rollup = require('rollup');
const resolve = require('rollup-plugin-node-resolve');
const commonjs = require('rollup-plugin-commonjs');

const ROLLUP_PLUGINS = [resolve(), commonjs()];

gulp.task('default', () => {});

gulp.task('build:background', async () => {
  console.log('building background');
  const bundle = await rollup.rollup({
    input: './src/background/main.js',
    plugins: ROLLUP_PLUGINS,
  });

  await bundle.write({
    file: './dist/background/main.js',
    format: 'iife',
  });
});

gulp.task('build:content_scripts', async () => {
  console.log('building content_scripts');
  const bundle = await rollup.rollup({
    input: './src/content_scripts/main.js',
    plugins: ROLLUP_PLUGINS,
  });

  await bundle.write({
    file: './dist/content_scripts/main.js',
    format: 'iife',
  });
});

gulp.task('build:all', ['build:background', 'build:content_scripts']);

@@ -243,24 +243,915 @@
 () =%3E %7B%7D);%0A%0A
+gulp.task('watch:background', async () =%3E %7B%0A  const input = './src/background/main.js';%0A  const watcher = rollup.watch(%7B%0A    input,%0A    plugins: ROLLUP_PLUGINS,%0A    output: %5B%0A      %7B%0A        file: './dist/background/main.js',%0A        format: 'iife',%0A      %7D,%0A    %5D,%0A    watch: %7B%0A      include: input,%0A    %7D,%0A  %7D);%0A%0A  watcher.on('event', (%7B code %7D) =%3E %7B%0A    console.log('background:', code);%0A  %7D);%0A%7D);%0A%0Agulp.task('watch:content_scripts', async () =%3E %7B%0A  const input = './src/content_scripts/main.js';%0A  const watcher = rollup.watch(%7B%0A    input,%0A    plugins: ROLLUP_PLUGINS,%0A    output: %5B%0A      %7B%0A        file: './dist/content_scripts/main.js',%0A        format: 'iife',%0A      %7D,%0A    %5D,%0A    watch: %7B%0A      include: input,%0A    %7D,%0A  %7D);%0A%0A  watcher.on('event', (%7B code %7D) =%3E %7B%0A    console.log('content_script:', code);%0A  %7D);%0A%7D);%0A%0Agulp.task('watch', %5B'watch:background', 'watch:content_scripts'%5D);%0A%0A
 gulp.task('b

Add watch task