Last active
November 15, 2019 22:20
-
-
Save zackseuberling/321c77718e665f2d0dabf7002e059df7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const path = require("path"); | |
const CleanWebpackPlugin = require("clean-webpack-plugin"); | |
const MiniCssExtractPlugin = require("mini-css-extract-plugin"); | |
const { version } = require("./package.json"); | |
module.exports = { | |
entry: { | |
core: "./core.css", | |
"core-high-contrast": "./core-high-contrast.css" | |
}, | |
module: { | |
rules: [ | |
{ | |
test: `${__dirname}/botanic/core.css`, | |
use: [ | |
MiniCssExtractPlugin.loader, | |
"css-loader", | |
"postcss-loader", | |
{ | |
loader: "postcss-loader", | |
options: { | |
ident: "core", | |
plugins: [ | |
require("tailwindcss")("./tailwind.config.js"), | |
require("postcss-import")(), | |
require("autoprefixer")(), | |
require("cssnano")() | |
] | |
} | |
} | |
] | |
}, | |
{ | |
test: `${__dirname}/botanic/core-high-contrast.css`, | |
use: [ | |
MiniCssExtractPlugin.loader, | |
"css-loader", | |
"postcss-loader", | |
{ | |
loader: "postcss-loader", | |
options: { | |
ident: "contast", | |
plugins: [ | |
require("tailwindcss")("./tailwind.contrast.config.js"), | |
require("postcss-import")(), | |
require("autoprefixer")(), | |
require("cssnano")() | |
] | |
} | |
} | |
] | |
} | |
] | |
}, | |
context: path.resolve(__dirname, "botanic"), | |
plugins: [ | |
new CleanWebpackPlugin({ verbose: true }), | |
new MiniCssExtractPlugin({ | |
filename: `[name].${version}.css` | |
}) | |
], | |
output: { | |
path: path.resolve(__dirname, "build/styles") | |
}, | |
watch: false | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment