How create build html ? #7082
Answered
by
DeMoorJasper
zababurinsv
asked this question in
Show and tell
-
I have this package.json "main": "./dist/index.mjs",
"source": "./frontend/src/index.mjs",
"type": "module",
"scripts": {
"dev": "parcel $npm_package_config_path_html --port $npm_package_config_port --no-source-maps --dist-dir ./docs ",
"build:html": "parcel build $npm_package_config_path_html --no-source-maps --dist-dir ./docs ",
"build": "parcel build $npm_package_config_path_mjs --no-source-maps --dist-dir ./dist ",
"kill": "kill $(lsof -t -i:$npm_package_config_initiator)",
"clean:parcel": "find . -name \".parcel-cache\" -exec rm -rf '{}' +; "
},
"devDependencies": {
"parcel": "2.0.0-rc.0"
}, This scripts is working. Not working also I get this error 🚨 Build failed.
@parcel/namer-default: Target "main" declares an output file path of "dist/index.mjs" which does not match the compiled bundle type "html".
/home/zb/Desktop/webrtc/frontend/src/modules/connect/package.json:5:11
4 | "version": "1.0.1",
> 5 | "main": "./dist/index.mjs",
> | ^^^^^^^^^^^^^^^^^^ Did you mean "dist/index.html"?
6 | "source": "./frontend/src/index.mjs",
7 | "type": "module",
💡 Try changing the file extension of "main" in package.json.
error Command failed with exit code 1. But it is script worked if i remove What should I add to the script to make the error go away ? |
Beta Was this translation helpful? Give feedback.
Answered by
DeMoorJasper
Oct 14, 2021
Replies: 2 comments 5 replies
-
The migration guide on the docs explains why this happens https://parceljs.org/getting-started/migration/#package.json%23main |
Beta Was this translation helpful? Give feedback.
5 replies
Answer selected by
DeMoorJasper
-
Thank you very match. i had find is this information |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The migration guide on the docs explains why this happens https://parceljs.org/getting-started/migration/#package.json%23main