rtfpessoa / diff2html

Pretty diff to html javascript library (diff2html)
https://diff2html.xyz
MIT License
2.9k stars 280 forks source link

fix 'yarn start:website' command #507

Closed shoito closed 1 year ago

shoito commented 1 year ago

When attempting to preview the website using the 'yarn start:website' command, the startup of webpack-dev-server failed.

❯ yarn start:website
yarn run v1.22.19
$ webpack-dev-server --mode development --config webpack.website.ts
/bin/sh: webpack-dev-server: command not found
error Command failed with exit code 127.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

I successfully set up the webpack-dev-server by installing the 'webpack-dev-server' package and using the 'serve' option of 'webpack-cli'.

❯ yarn start:website
yarn run v1.22.19
$ webpack serve --mode development --config webpack.website.ts
<i> [webpack-dev-server] Project is running at:
<i> [webpack-dev-server] Loopback: http://localhost:8080/
<i> [webpack-dev-server] On Your Network (IPv4): http://192.168.128.136:8080/
<i> [webpack-dev-server] On Your Network (IPv6): http://[fe80::1]:8080/
<i> [webpack-dev-server] Content not from webpack is served from '/Users/shoito/workspaces/diff2html/public' directory

Installing the webpack-dev-server package was necessary. Without it, the situation would be as follows:

❯ npx webpack serve --mode development --config webpack.website.ts
[webpack-cli] For using 'serve' command you need to install: 'webpack-dev-server' package.
[webpack-cli] Would you like to install 'webpack-dev-server' package? (That will run 'yarn add -D webpack-dev-server') (Y/n)
rtfpessoa commented 1 year ago

LGTM 👍 Thanks for the contribution

shoito commented 1 year ago

Thanks for the review and merge, @rtfpessoa 😄