1 const path = require('path');
2 const MiniCssExtractPlugin = require('mini-css-extract-plugin');
3 const HtmlWebpackPlugin = require('html-webpack-plugin');
4 const postcssPresetEnv = require('postcss-preset-env');
5 const postcssGridKiss = require('postcss-grid-kiss');
6 const autoprefixer = require('autoprefixer');
8 const cssDir = path.resolve(__dirname, 'css');
9 const outDir = path.resolve(cssDir, 'dist');
11 module.exports = (env, argv) => ({
13 devtool: argv.mode === 'production' ? 'source-map' : 'inline-source-map',
15 host: '0.0.0.0', // so we can export it from docker
19 new MiniCssExtractPlugin(),
20 new HtmlWebpackPlugin({
21 template: path.resolve(cssDir, 'index.html'),
25 css: path.resolve(cssDir, 'index.js'),
28 filename: '[name].js',
34 test: /\.(scss|css)$/i,
36 MiniCssExtractPlugin.loader,
40 { loader: 'postcss-loader', options: { plugins: () => [
41 postcssGridKiss({fallback: false}),
42 autoprefixer({grid: "no-autoplace"}),
51 'IE does not support justify-content on grid containers',
52 /IE does not support justify-content on grid containers/,
53 (warning) => !/IE does not support justify-content on grid containers/.test(warning),