Skip to content

Commit

Permalink
fix(demos): postcss webpack config for todomvc
Browse files Browse the repository at this point in the history
  • Loading branch information
unstubbable committed Feb 27, 2021
1 parent b64dc1a commit f98a155
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions packages/demos/src/todomvc/webpack-config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
// @ts-check
const CopyPlugin = require('copy-webpack-plugin');
const path = require('path');
// @ts-ignore
const postcssPresetEnv = require('postcss-preset-env');
const webpack = require('webpack');
const {merge} = require('webpack-merge');
const {merge, mergeWithRules} = require('webpack-merge');
const {webpackBaseConfig} = require('../webpack-base-config');

const websiteBuildDirname = path.resolve(
Expand Down Expand Up @@ -45,7 +43,14 @@ const configs = [
publicPath: '/main',
},
}),
merge(webpackBaseConfig, {
mergeWithRules({
module: {
rules: {
test: /** @type {import('webpack-merge').CustomizeRule.Match} */ ('match'),
use: /** @type {import('webpack-merge').CustomizeRule.Replace} */ ('replace'),
},
},
})(webpackBaseConfig, {
entry: path.join(__dirname, './footer/index.tsx'),
externals: {
react: 'react',
Expand All @@ -72,12 +77,12 @@ const configs = [
sourceMap: true,
},
},

{
loader: 'postcss-loader',
options: {
ident: 'postcss',
plugins: () => [postcssPresetEnv({stage: 0})],
postcssOptions: {
plugins: [['postcss-preset-env']],
},
},
},
],
Expand Down

0 comments on commit f98a155

Please sign in to comment.