W
W
Wasya UK2018-08-20 15:27:59
JavaScript
Wasya UK, 2018-08-20 15:27:59

How to render entire folder with styles in webpack?

I have a folder with all styles, but they are written in .sass. How to use webpack to select several files or all, but without using entry , because then the styles are duplicated in .js. Used include , but didn't help.

{
        test: /\.(sa|sc|c)ss$/,
        include: path.resolve(__dirname, '../src/sass'),
        use: [
          MiniCssExtractPlugin.loader,
          'css-loader',
          'sass-loader',
        ],
      }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Belyaev, 2018-08-20
@bingo347

https://webpack.js.org/guides/dependency-management...

(require => r.keys().forEach(require))(require.context('./sass/', false, /\.(sa|sc|c)ss$/));

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question