diff --git a/package.json b/package.json index 24e7d49..1c4f48a 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/config.js b/src/config.js index 437c7ec..815a312 100644 --- a/src/config.js +++ b/src/config.js @@ -12,6 +12,9 @@ module.exports = { 'Access-Control-Allow-Origin': '*', }, hot: true, + devMiddleware: { + writeToDisk: true, + }, }, watchOptions: { diff --git a/src/externals.js b/src/externals.js index d0630da..7fcab9f 100644 --- a/src/externals.js +++ b/src/externals.js @@ -42,7 +42,6 @@ module.exports = [ 'hooks', 'html-entities', 'i18n', - 'icons', 'interface', 'is-shallow-equal', 'keyboard-shortcuts', diff --git a/src/helpers/clean-on-exit.js b/src/helpers/clean-on-exit.js index 72b51c0..106e31f 100644 --- a/src/helpers/clean-on-exit.js +++ b/src/helpers/clean-on-exit.js @@ -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. diff --git a/src/plugins.js b/src/plugins.js index 1c4b8b8..4158fd1 100644 --- a/src/plugins.js +++ b/src/plugins.js @@ -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( { @@ -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, } ), /**