Trying to collect a project using WebPack. The project is going, no errors occur. However, the bundle.js file is not created. What do I do wrong?
file package.json:
{
"Name": "ezsadmin",
"Version": "1.0.0",
"Description": "Administrative panel",
"Main": "WebPack.config.js",
"scripts": {
"Build": "WebPack",
"Start": "WebPack --watch"
},
"Repository": {
"TYPE": "Git",
"URL": "SSH: // WERFWERFWE"
},
"Author": "",
"License": "ISC",
"DevDependencies": {
"@ Babel / Core": "^ 7.13.14",
"Babel-Loader": "^ 8.2.2",
"WebPack": "^ 5.30.0",
"WebPack-Cli": "^ 4.6.0"
},
"Dependencies": {
"@ Babel / plugin-transform-react-jsx": "^ 7.13.12",
"@ Babel / Preset-Env": "^ 7.13.12",
"@ Babel / PRESET-REACT": "^ 7.13.13",
"Babel": "^ 6.23.0",
"Babel-Core": "^ 6.26.3",
"File-Loader": "^ 6.2.0",
"REACT": "^ 17.0.2",
"REACT-DOM": "^ 17.0.2",
"WebPack-Dev-Server": "^ 3.11.2"
}
}
WebPack.config.js file:
var pat = require ('path');
module.exports = {
Entry: './assets/js/main.js',
Module: {
Rules: [
{test: /\.svg$/, USE: 'SVG-inline-Loader'},
{test: /\.css$/, Use: ['Style-Loader', 'Css-loader']},
{test: / \.(js)$/, USE: 'Babel-Loader'}
],
},
Output: {
FileName: 'bundle.js',
Path: Path.Resolve (__ Dirname, '/ Public / JS /')
},
Mode: 'PRODUCTION'
};
Babel.config.json file:
{
"Presets": ["@ Babel / Preset-React", "@ Babel / Preset-Env"],
"Plugins": ["@ Babel / plugin-transform-react-jsx"]
}
here file Bundle.js I watched – I did not understand.
Answer 1
Error in
path: path.resolve (__ dirname, '/ public / js /')
file was created, but in the root of the hard disk.