A
A
Alex Ozerov2021-12-19 14:36:21
webpack
Alex Ozerov, 2021-12-19 14:36:21

Why doesn't webpack import node_modules?

webpack.config.js

const path = require('path')

module.exports = {
    resolve: {
        alias: {
            'node_modules': path.join(__dirname, 'node_modules'),
        }
    },
    output: {
        filename: 'index.min.js',
    },
    module: {
        rules: [
            {
                test: /\.js$/,
                // exclude: /(node_modules)/,
                loader: 'babel-loader',
            },
        ],
    },
};


index.js
//Import sources
import "jquery";
import '@popperjs/core'
import 'bootstrap'
import 'slick-carousel'
import 'regenerator-runtime'
import 'three'


It does not import modules from node modules into any. Works in conjunction with Galp, so there is no entry. From other files, everything imports well. What is the problem ?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Belyaev, 2021-12-19
@bingo347

It imports everything, you just don't understand how the modules work:
https://developer.mozilla.org/ru/docs/Web/JavaScri...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question