A
A
Alex_872020-10-19 13:08:03
JavaScript
Alex_87, 2020-10-19 13:08:03

webpack setup?

Hello! There is a webpack file taken from Vladilen Minin. I'm trying to customize it for myself, removing (as it seems to me) everything superfluous. Already removed modules like:

"devDependencies": {

"@babel/preset-react": "^7.8.3",
"@babel/preset-typescript": "^7.8.3",
"csv-loader": "^3.0.2",
"node-sass": "^4.13.0",
"papaparse": "^5.1.1",
"sass-loader": "^8.0.2",
"terser-webpack-plugin ": "^2.3.2",
"webpack-bundle-analyzer": "^3.6.0",
"xml-loader": "^1.2.1"
},
"

but some other modules may have remained. Personally, I try to reduce everything to the minimum settings, without which no project is possible. That is, modules that are needed everywhere. I'm asking for help cleaning up package.json and webpack.config if possible and setting up the dist build so that when it is built it contains an index.html file, a folder with js files, a folder with css files, and an image folder (or maybe just this the folder is superfluous and you need to create this folder yourself, without processing from the src folder. What do you think) and that's it. It's just that the structure that now appears in the dist folder is not clear to me. In addition, there are some vendors files that I don't need. I don't know what it is... Please help!

Folder link: https://dropmefiles.com/Svkwp

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey delphinpro, 2020-10-19
@delphinpro

Starting with version 4, webpack adheres to the principle of zero config. You just create a src folder, main.js file in it and run webpack. Start with this. Then add the loaders and plugins you need. Just look at the documentation and do as it is written. Webpack has a very good dock.

A
approximate solution, 2020-10-19
@approximate_solution

Most of what you removed is critical to the project. Do not go into webpack if you do not understand what you are deleting.
I advise you to watch this course to get at least a little understanding of how webpack works under the hood - https://coursehunter.net/course/webpack .
Climbing there without understanding how arrays, objects work and not knowing how to google is pointless. I think you've come too early to webpack. First you need to pull yourself up to at least knowledge of native JS.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question