Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const path = require('path')
const webpack = require('webpack')
const CleanWebpackPlugin = require('clean-webpack-plugin').default
const HtmlWebpackPlugin = require('html-webpack-plugin')
const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin')
/** @type {webpack.Configuration} */
const config = {
mode: 'development',
watch: true,
devtool: 'source-map',
entry: {
background: './src/background',
popup: './src/popup',
dashboard: './src/dashboard',
},
output: {
path: path.resolve('chrome/dist'),
filename: '[name].js',
//@ts-check
'use strict';
const { join, resolve, dirname } = require('path');
const fs = require('fs');
const webpack = require('webpack');
const CleanWebpackPlugin = require('clean-webpack-plugin').default;
/**
* @template T
* @param { (cb: (e?: Error, r?: T) => void) => any } func
* @return { Promise }
*/
function wrap(func) {
return new Promise((res, rej) => {
try {
func((e, r) => e ? rej(e) : res(r));
} catch (e) {
rej(e);
}
});
}