Skip to content

Commit

Permalink
Fix & rename v2 (#12)
Browse files Browse the repository at this point in the history
* Rename webpack.config.js; fix undefined usage w middleware

* Rename exported function
  • Loading branch information
craigbeck authored Apr 18, 2023
1 parent 8794403 commit fb55c32
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion webpack.config.js → createConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
const { WebpackDeduplicationPlugin } = require('webpack-deduplication-plugin');
const { WebpackManifestPlugin } = require('webpack-manifest-plugin');
const path = require('path');
const webpack = require('webpack');

const DerbyViewsPlugin = require('./lib/DerbyViewPlugin');

module.exports = function(webpack, apps, rootDir, opts = {}) {
module.exports = function createConfig(apps, rootDir, opts = {}) {
const options = {
hotModuleReplacement: false,
defines: {},
Expand Down
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ const webpackHotMiddleware = require("webpack-hot-middleware");
*
* @param {webpack.Configuration} webpackConfig
*/
exports.createWebpackCompiler = function getMiddleware(webpackConfig) {
exports.createMiddleware = function createMiddleware(webpackConfig) {
const webpackCompiler = webpack(webpackConfig);

const devMiddleware = webpackMiddleware(webpackCompiler, {
serverSideRender: true,
index: false,
publicPath: resolvedConfig.output.publicPath,
publicPath: webpackConfig.output.publicPath,
headers: (req, res, _context) => {
const origin = req.headers['origin'];
if (!origin) return;
Expand Down

0 comments on commit fb55c32

Please sign in to comment.