E
E
evgenin2022-03-05 01:15:05
webpack
evgenin, 2022-03-05 01:15:05

How can I change class names in js and css Webpack?

Small application, all in one js, need to prefix classes in js and css files

module: {
        rules: [
            {
                test: /\.(js|jsx)$/,
                exclude: /(node_modules|bower_components)/,
                loader: "babel-loader",
                options: { presets: ["@babel/env", "@babel/preset-react"] }
            },
            {
                test: /\.css$/,
                use: ["style-loader", "css-loader"],
            },
            {
                test: /\.scss$/,
                use: ['style-loader', 'css-loader', 'sass-loader']
            }
        ]
    },

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
evgenin, 2022-03-05
@evgenin

In general, the task could have been easier to solve,
created a scss file and limited the zone of the div block

#myVeryInterestingApp {
  @import "~bootstrap/scss/bootstrap.scss";
  @import "./style.scss";
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question