Closed someniatko closed 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:
npx webpack-dev-server
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" }
Yes, it's possible, use publicPath: https://github.com/danethurber/webpack-manifest-plugin#optionspublicpath
publicPath
Minimal example:
webpack.config.js:
i run
npx webpack-dev-server
in the project root, and manifest is created as expected:its contents is the following:
however, i expect something like:
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: