2019-09-04 19:53:13 +02:00
|
|
|
const autoprefixer = require('autoprefixer');
|
2021-07-26 13:22:25 +02:00
|
|
|
const path = require('path');
|
|
|
|
|
const tailwindcss = require('tailwindcss');
|
2023-09-01 22:19:39 +02:00
|
|
|
const tailwindConfigPath = path.resolve('../../platform/app/tailwind.config.js');
|
2021-07-26 13:22:25 +02:00
|
|
|
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
|
|
|
|
const devMode = process.env.NODE_ENV !== 'production';
|
2019-09-04 19:53:13 +02:00
|
|
|
|
|
|
|
|
const cssToJavaScript = {
|
|
|
|
|
test: /\.css$/,
|
|
|
|
|
use: [
|
2021-07-26 13:22:25 +02:00
|
|
|
//'style-loader',
|
|
|
|
|
devMode ? 'style-loader' : MiniCssExtractPlugin.loader,
|
2019-09-04 19:53:13 +02:00
|
|
|
{ loader: 'css-loader', options: { importLoaders: 1 } },
|
|
|
|
|
{
|
|
|
|
|
loader: 'postcss-loader',
|
|
|
|
|
options: {
|
2021-07-26 13:22:25 +02:00
|
|
|
postcssOptions: {
|
|
|
|
|
verbose: true,
|
|
|
|
|
plugins: [
|
|
|
|
|
[tailwindcss(tailwindConfigPath)],
|
|
|
|
|
[autoprefixer('last 2 version', 'ie >= 11')],
|
|
|
|
|
],
|
|
|
|
|
},
|
2019-09-04 19:53:13 +02:00
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
module.exports = cssToJavaScript;
|