shellscape / webpack-manifest-plugin

webpack plugin for generating asset manifests
MIT License
1.43k stars 186 forks source link

webpack-dev-server's URL is not present in manifest.json #161

Closed someniatko closed 5 years ago

someniatko commented 5 years ago

Minimal example:

src/
---- index.js
node_modules/
---- ...
package.json
package-lock.json
webpack.config.js

webpack.config.js:

const ManifestPlugin = require('webpack-manifest-plugin');

module.exports = {
    plugins: [
        new ManifestPlugin({
            writeToFileEmit: true,
        })
    ]
};

i run npx webpack-dev-server in the project root, and manifest is created as expected:

dist/
---- manifest.json

its contents is the following:

{
  "main.js": "main.js"
}

however, i expect something like:

{
  "main.js": "http://localhost:8080/main.js"
}

is it expected behavior, and if so, is the plugin configurable somehow to be able to include dev-server's URL?

my package.json's dependencies:

  "devDependencies": {
    "webpack": "^4.17.2",
    "webpack-cli": "^3.1.0",
    "webpack-dev-server": "^3.1.7",
    "webpack-manifest-plugin": "^2.0.3"
  }
mastilver commented 5 years ago

Yes, it's possible, use publicPath: https://github.com/danethurber/webpack-manifest-plugin#optionspublicpath