Skip to content

Commit

Permalink
chore: add postcss setup
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaofan2406 committed Jun 23, 2022
1 parent 741170b commit 98255fb
Show file tree
Hide file tree
Showing 9 changed files with 1,400 additions and 71 deletions.
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
www/containers/props.json
package-lock.json
dist
es
lib
16 changes: 0 additions & 16 deletions config/postCssConfig.js

This file was deleted.

4 changes: 1 addition & 3 deletions config/webpack.config.dev.build.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ const { merge: webpackMerge } = require('webpack-merge');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const commonConfig = require('./webpack.config');
const paths = require('./paths');
const postCssConfig = require('./postCssConfig');

// This is the development configuration.
// It is focused on developer experience and fast rebuilds.
Expand Down Expand Up @@ -71,13 +70,12 @@ module.exports = webpackMerge(commonConfig, {
{
loader: 'css-loader',
options: {
importLoaders: 2,
importLoaders: 1,
sourceMap: false,
},
},
{
loader: 'postcss-loader',
options: postCssConfig,
},
'sass-loader',
],
Expand Down
4 changes: 1 addition & 3 deletions config/webpack.config.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ const HtmlWebpackPlugin = require('html-webpack-plugin');
const CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin');
const commonConfig = require('./webpack.config');
const paths = require('./paths');
const postCssConfig = require('./postCssConfig');

// This is the development configuration.
// It is focused on developer experience and fast rebuilds.
Expand Down Expand Up @@ -75,12 +74,11 @@ module.exports = webpackMerge(commonConfig, {
{
loader: 'css-loader',
options: {
importLoaders: 2,
importLoaders: 1,
},
},
{
loader: 'postcss-loader',
options: postCssConfig,
},
{ loader: 'sass-loader' },
],
Expand Down
4 changes: 1 addition & 3 deletions config/webpack.config.dist.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ const TerserPlugin = require('terser-webpack-plugin');
const CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
const commonConfig = require('./webpack.config');
const paths = require('./paths');
const postCssConfig = require('./postCssConfig');

// Assert this just to be safe.
if (process.env.NODE_ENV !== 'dist') {
Expand Down Expand Up @@ -90,13 +89,12 @@ module.exports = webpackMerge(commonConfig, {
{
loader: 'css-loader',
options: {
importLoaders: 2,
importLoaders: 1,
sourceMap: false,
},
},
{
loader: 'postcss-loader',
options: postCssConfig,
},
'sass-loader',
],
Expand Down
4 changes: 1 addition & 3 deletions config/webpack.config.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ const TerserPlugin = require('terser-webpack-plugin');
const CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
const commonConfig = require('./webpack.config');
const paths = require('./paths');
const postCssConfig = require('./postCssConfig');

// Assert this just to be safe.
if (process.env.NODE_ENV !== 'production') {
Expand Down Expand Up @@ -94,13 +93,12 @@ module.exports = webpackMerge(commonConfig, {
{
loader: 'css-loader',
options: {
importLoaders: 2,
importLoaders: 1,
sourceMap: false,
},
},
{
loader: 'postcss-loader',
options: postCssConfig,
},
'sass-loader',
],
Expand Down
Loading

0 comments on commit 98255fb

Please sign in to comment.