@elliemae/pui-cli 7.0.0-beta.8 → 7.0.0-beta.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -238,4 +238,5 @@ module.exports = (options) => ({
238
238
  },
239
239
  devtool: options.devtool || 'eval-source-map',
240
240
  performance: options.performance || {},
241
+ devServer: options.devServer || {},
241
242
  });
@@ -1,9 +1,13 @@
1
+ /* eslint-disable max-lines */
1
2
  const path = require('path');
2
3
  const HtmlWebpackPlugin = require('html-webpack-plugin');
3
4
  const CircularDependencyPlugin = require('circular-dependency-plugin');
4
5
  const MiniCssExtractPlugin = require('mini-css-extract-plugin');
5
6
  const ReactRefreshWebpackPlugin = require('@pmmmwh/react-refresh-webpack-plugin');
6
7
  const SpeedMeasurePlugin = require('speed-measure-webpack-plugin');
8
+ const expressStaticGzip = require('express-static-gzip');
9
+ const { setupDefaultMiddlewares } = require('../server/middlewares');
10
+ const { loadRoutes } = require('../server/util');
7
11
 
8
12
  const smp = new SpeedMeasurePlugin({ disable: !process.env.MEASURE });
9
13
 
@@ -16,6 +20,7 @@ const baseConfigFactory = require('./webpack.base.babel');
16
20
 
17
21
  const {
18
22
  appVersion,
23
+ buildPath,
19
24
  userMonScriptPath,
20
25
  globalScriptPath,
21
26
  appLoaderScriptPath,
@@ -36,14 +41,13 @@ const devConfig = {
36
41
 
37
42
  // Add hot reloading in development
38
43
  entry: {
39
- app: [
40
- 'webpack-hot-middleware/client',
41
- path.join(process.cwd(), 'app/index'),
42
- ],
44
+ app: path.join(process.cwd(), 'app/index'),
43
45
  },
44
46
 
45
47
  // Don't use hashes in dev mode for better performance
46
48
  output: {
49
+ path: buildPath,
50
+ publicPath: 'auto',
47
51
  filename: '[name].js',
48
52
  chunkFilename: '[name].chunk.js',
49
53
  assetModuleFilename: '[name][ext][query]',
@@ -103,7 +107,24 @@ const devConfig = {
103
107
  hints: false,
104
108
  },
105
109
 
106
- devServer: {},
110
+ devServer: {
111
+ client: {
112
+ overlay: {
113
+ errors: true,
114
+ warnings: false,
115
+ },
116
+ },
117
+ historyApiFallback: true,
118
+ hot: true,
119
+ open: true,
120
+ port: 3000,
121
+ setupMiddlewares: (middlewares, devServer) => {
122
+ setupDefaultMiddlewares(devServer.app);
123
+ devServer.app.use(expressStaticGzip('cdn'));
124
+ loadRoutes(devServer.app);
125
+ return middlewares;
126
+ },
127
+ },
107
128
  };
108
129
 
109
130
  const config = smp.wrap(baseConfigFactory(devConfig));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/pui-cli",
3
- "version": "7.0.0-beta.8",
3
+ "version": "7.0.0-beta.9",
4
4
  "private": false,
5
5
  "description": "ICE MT UI Platform CLI",
6
6
  "sideEffects": false,