Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@humanmade/webpack-helpers",
"public": true,
"version": "1.0.0-alpha",
"version": "1.0.4-alpha",
"description": "Reusable Webpack configuration components & related helper utilities.",
"main": "index.js",
"author": "Human Made",
Expand Down
3 changes: 3 additions & 0 deletions src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ module.exports = {
'Access-Control-Allow-Origin': '*',
},
hot: true,
devMiddleware: {
writeToDisk: true,
},
},

watchOptions: {
Expand Down
1 change: 0 additions & 1 deletion src/externals.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ module.exports = [
'hooks',
'html-entities',
'i18n',
'icons',
'interface',
'is-shallow-equal',
'keyboard-shortcuts',
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/clean-on-exit.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const { unlinkSync } = require( 'fs' );
const onExit = require( 'signal-exit' );
const { onExit } = require( 'signal-exit' );

/**
* Register an onExit handler to remove one or more files when the server exits.
Expand Down
12 changes: 10 additions & 2 deletions src/plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,9 @@ module.exports = {
* assets from the development server. A publicPath matching the URL
* in the configuration's output.publicPath is required.
*
* @param {Object} options Plugin options overrides.
* @param {String} options.publicPath The base URI to prepend to build asset URIs.
* @param {Object} options Plugin options overrides.
* @param {String} [options.publicPath] The base URI to prepend to build asset URIs
* @param {String} [options.basePath] Base path for manifest entries
* @returns {ManifestPlugin} A configured ManifestPlugin instance.
*/
manifest: ( options = {} ) => new ManifestPlugin( {
Expand All @@ -143,6 +144,13 @@ module.exports = {
return file;
},
...options,
/**
* Set basePath and publicPath to empty strings to prevent webpack-manifest-plugin v5+ from
* adding 'auto/' prefix to asset paths, which doesn't match build output structure
* These come after ...options to ensure they take precedence
*/
basePath: options.basePath === undefined ? '' : options.basePath,
publicPath: options.publicPath === undefined ? '' : options.publicPath,
} ),

/**
Expand Down