Skip to content

Commit

Permalink
build: Fix webpack-plugin-serve prod warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
evanpurkhiser committed Jan 18, 2021
1 parent cfad37c commit b4f5bc4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions webpack.config.base.ts
Expand Up @@ -14,6 +14,9 @@ const envConfig = {
COMMIT: commit,
};

export const withWebpackPluginServe = (appList: string[]) =>
[...appList, IS_PROD ? '' : 'webpack-plugin-serve/client'].filter(s => s !== '');

export const baseConfig: webpack.Configuration = {
mode: IS_PROD ? 'production' : 'development',
watch: process.env.NODE_ENV !== 'production',
Expand Down
4 changes: 2 additions & 2 deletions webpack.config.renderer.ts
Expand Up @@ -7,7 +7,7 @@ import {WebpackPluginServe} from 'webpack-plugin-serve';

import path from 'path';

import {baseConfig} from './webpack.config.base';
import {baseConfig, withWebpackPluginServe} from './webpack.config.base';

const serve = new WebpackPluginServe({
port: 2003,
Expand All @@ -21,7 +21,7 @@ const serve = new WebpackPluginServe({
const rendererConfig: webpack.Configuration = merge(baseConfig, {
target: 'electron-renderer',
entry: {
app: ['./src/renderer/app.tsx', 'webpack-plugin-serve/client'],
app: withWebpackPluginServe(['./src/renderer/app.tsx']),
},
optimization: {minimize: false},
module: {
Expand Down
4 changes: 2 additions & 2 deletions webpack.config.website.ts
Expand Up @@ -7,11 +7,11 @@ import {WebpackPluginServe} from 'webpack-plugin-serve';

import path from 'path';

import {baseConfig} from './webpack.config.base';
import {baseConfig, withWebpackPluginServe} from './webpack.config.base';

const websiteConfig: webpack.Configuration = merge(baseConfig, {
entry: {
app: ['./src/website/app.tsx', 'webpack-plugin-serve/client'],
app: withWebpackPluginServe(['./src/website/app.tsx']),
},
output: {
path: path.resolve(__dirname, 'dist/website'),
Expand Down

1 comment on commit b4f5bc4

@vercel
Copy link

@vercel vercel bot commented on b4f5bc4 Jan 18, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.