Setting up webpack?

  • 0
    Hello! There is a webpack file from Vladilen Minin. I'm trying to customize it for myself, removing (as it seems to me) all unnecessary. Already removed such modules as:

    "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"
    "dependencies": {
    "react": "^ 16.12.0",
    "react-dom": "^ 16.12.0"

    but some other modules may remain. Personally, I try to reduce everything to the minimum settings, without which no project is possible. That is, modules that are needed everywhere. I ask you to help clean up the package.json and webpack.config if possible and configure the dist assembly so that when building it contains an index.html file, a folder with js files, a folder with css files, and a folder with images (or maybe just this the folder is superfluous and you need to create this folder yourself, without processing from the src folder. 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. Also, some vendors files appear that I don't need. I don't know what it is ... Please help!

    Link to folder:
    JavaScript Mason McCarty, Apr 25, 2019

  • 2 Answers
  • 0
    Since version 4 webpack adheres to the zero config principle. You just create a src folder with your main.js file in it and run the webpack. That's where you start. Then add the loaders and plugins you need. Just look at the documentation and do as it is written. The webpack has a very good dock.

  • 0
    Most of what you've deleted is project-critical. You don't have to go into the webpack if you don't 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 - webpack .

    It makes no sense to go there without understanding how arrays and objects work and not being able to google. You came to the webpack too early for me. First, you need to pull yourself up to at least knowledge of native JS.
    Hunter Waters

Your Answer
To place the code, please use CodePen or similar tool. Thanks you!