Sha256: c8caa61f141c6a59955b460a22464639cb44a6ea0a7da442bf965a5d3989e232
Contents?: true
Size: 935 Bytes
Versions: 14
Compression:
Stored size: 935 Bytes
Contents
/* eslint global-require: 0 */ const { canProcess, moduleExists } = require('./helpers') const inliningCss = require('./inliningCss') const getStyleRule = (test, preprocessors = []) => { if (moduleExists('css-loader')) { const tryPostcss = () => canProcess('postcss-loader', (loaderPath) => ({ loader: loaderPath, options: { sourceMap: true } })) // style-loader is required when using css modules with HMR on the webpack-dev-server const use = [ inliningCss ? 'style-loader' : require('mini-css-extract-plugin').loader, { loader: require.resolve('css-loader'), options: { sourceMap: true, importLoaders: 2, modules: { auto: true } } }, tryPostcss(), ...preprocessors ].filter(Boolean) return { test, use } } return null } module.exports = getStyleRule
Version data entries
14 entries across 14 versions & 1 rubygems