Skip to content

Commit

Permalink
fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveRusin committed Sep 21, 2021
1 parent 8037965 commit 57faf39
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 28 deletions.
2 changes: 0 additions & 2 deletions config/index.ts

This file was deleted.

5 changes: 0 additions & 5 deletions config/webpack.config.common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@ import HtmlWebpackPlugin from "html-webpack-plugin";

export const config: Configuration = {
entry: resolve("src", "index.tsx"),
output: {
path: resolve("build"),
filename: "[name].[chunkhash].bundle.js",
clean: true,
},
resolve: {
extensions: [".tsx", ".ts", ".js"],
},
Expand Down
8 changes: 7 additions & 1 deletion config/webpack.config.dev.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@

import { merge } from 'webpack-merge';
import { resolve } from 'path';

import { config } from './webpack.config.common';
import { WebpackDevConfiguration } from './webpack.models';

export const webpackDevConfigPart: WebpackDevConfiguration = {
mode: 'development',
devtool: 'source-map',
output: {
path: resolve("build"),
filename: "[name].bundle.js",
clean: true,
},
devServer: {
open: true,
hot: true,
},
};

export const webpackDevConfig = merge(config, webpackDevConfigPart);
export default merge(config, webpackDevConfigPart);
10 changes: 8 additions & 2 deletions config/webpack.config.prod.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
import { Configuration, WebpackPluginInstance } from "webpack";
import { resolve } from 'path';
import { Configuration } from "webpack";
import { merge } from "webpack-merge";
import CompressionPlugin from "compression-webpack-plugin";

import { config } from "./webpack.config.common";

const webpackProdConfigPart: Configuration = {
mode: "production",
output: {
path: resolve("build"),
filename: "[name].[chunkhash].bundle.js",
clean: true,
},
performance: {
hints: "warning",
maxAssetSize: 1_000_000,
Expand All @@ -25,4 +31,4 @@ const webpackProdConfigPart: Configuration = {
],
};

export const webpackProdConfig = merge(config, webpackProdConfigPart);
export default merge(config, webpackProdConfigPart);
9 changes: 0 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
"babel-loader": "^8.2.2",
"babel-plugin-styled-components": "^1.13.2",
"compression-webpack-plugin": "^9.0.0",
"cross-env": "^7.0.3",
"html-webpack-plugin": "^5.3.2",
"ts-loader": "^9.2.5",
"ts-node": "^10.2.1",
Expand All @@ -35,8 +34,8 @@
"webpack-merge": "^5.8.0"
},
"scripts": {
"start": "cross-env NODE_ENV=dev webpack server",
"build": "cross-env NODE_ENV=production webpack build"
"start": "webpack server --config config/webpack.config.dev.ts",
"build": "webpack build --config config/webpack.config.prod.ts"
},
"repository": {
"type": "git",
Expand Down
6 changes: 0 additions & 6 deletions webpack.config.ts

This file was deleted.

0 comments on commit 57faf39

Please sign in to comment.