<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>React</title>
</head>
<body>
<div id="root"></div>
<script src="main.js"></script>
</body>
</html>
{
"name": "WebpackBabel",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "webpack serve --mode development --open --hot",
"build": "webpack --mode production"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"webpack": "^5.51.1",
"webpack-cli": "^4.8.0",
"webpack-dev-server": "^4.0.0"
},
"dependencies": {
"react": "^17.0.2",
"react-dom": "^17.0.2"
}
}
Ao executar na cli o comando npm start C:\Users\alex_\OneDrive\Área de Trabalho\Em curso\Origamid\REACT\WebpackBabel> npm start
> WebpackBabel@1.0.0 start
> webpack serve --mode development --open --hot
<i> [webpack-dev-server] Project is running at:
<i> [webpack-dev-server] Loopback: http://localhost:8081/
<i> [webpack-dev-server] On Your Network (IPv4): http://10.0.0.111:8081/
<i> [webpack-dev-server] Content not from webpack is served from 'C:\Users\alex_\OneDrive\Área de Trabalho\Em
curso\Origamid\REACT\WebpackBabel\public' directory
asset main.js 283 KiB [emitted] (name: main)
runtime modules 27.1 KiB 13 modules
modules by path ./node_modules/ 197 KiB
modules by path ./node_modules/webpack-dev-server/client/ 50.7 KiB 12 modules
modules by path ./node_modules/webpack/hot/*.js 4.3 KiB 4 modules
modules by path ./node_modules/html-entities/lib/*.js 81.3 KiB 4 modules
modules by path ./node_modules/url/ 37.4 KiB 3 modules
modules by path ./node_modules/querystring/*.js 4.51 KiB
./node_modules/querystring/index.js 127 bytes [built] [code generated]
./node_modules/querystring/decode.js 2.34 KiB [built] [code generated]
./node_modules/querystring/encode.js 2.04 KiB [built] [code generated]
./node_modules/ansi-html/index.js 4.16 KiB [built] [code generated]
./node_modules/events/events.js 14.5 KiB [built] [code generated]
./src/index.js 102 bytes [built] [code generated]
webpack 5.51.1 compiled successfully in 3653 ms
No console do navegador navegador: Failed to load resource: the server responded with a status of 404 (Not Found) Estou dentro da pasta do projeto.