Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const argv = require('webpack-nano/argv')
const p = require('path')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const { WebpackPluginServe } = require('webpack-plugin-serve')
const isDev = argv.watch || argv.serve || process.env.NODE_ENV === 'development'
let output = 'dist'
let ramdisk = false
if (isDev) {
// Optional ramdisk arg to build in a ramdisk (faster!)
ramdisk = !!argv.ramdisk || !!process.env.WP_RAM
output = ramdisk ? 'build-ramdisk' : 'build'
}
output = p.join(__dirname, output)
const config = {
entry: ['./src/index.js'],
mode: isDev ? 'development' : 'production',
watch: argv.watch || argv.serve,
devtool: isDev ? 'eval-source-map' : 'none',
// stats: 'minimal',
stats: 'minimal',
module: {
rules: [
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,