Skip to content

Commit 8f52376

Browse files
committed
feature: cloudcmd: revert: optimize-css-assets-webpack-plugin -> css-minimizer-webpack-plugin: broken spinner
This reverts commit 8200874.
1 parent ed31dd2 commit 8f52376

File tree

5 files changed

+13
-22
lines changed

5 files changed

+13
-22
lines changed

.webpack/css.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
11
'use strict';
22

3+
const {env} = require('node:process');
4+
5+
const OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin');
36
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
47

8+
const isDev = env.NODE_ENV === 'development';
9+
510
const clean = (a) => a.filter(Boolean);
611

712
const plugins = clean([
813
new MiniCssExtractPlugin({
914
filename: '[name].css',
1015
}),
16+
!isDev && new OptimizeCssAssetsPlugin(),
1117
]);
1218

1319
const rules = [{

.webpack/js.js

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ const {
1313
} = require('webpack');
1414

1515
const WebpackBar = require('webpackbar');
16-
const CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
1716

1817
const modules = './modules';
1918
const dirModules = './client/modules';
@@ -106,18 +105,6 @@ module.exports = {
106105
devtool,
107106
optimization: {
108107
splitChunks,
109-
minimize: true,
110-
minimizer: [
111-
new CssMinimizerPlugin({
112-
minimizerOptions: {
113-
preset: ['default', {
114-
discardComments: {
115-
removeAll: true,
116-
},
117-
}],
118-
},
119-
}),
120-
],
121108
},
122109
entry: {
123110
'themes/dark': `${dirThemes}/dark.css`,

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,6 @@
168168
"clean-css-loader": "^4.2.1",
169169
"codegen.macro": "^4.0.0",
170170
"css-loader": "^7.1.2",
171-
"css-minimizer-webpack-plugin": "^7.0.2",
172171
"css-modules-require-hook": "^4.2.3",
173172
"domtokenlist-shim": "^1.2.0",
174173
"emitify": "^4.0.1",
@@ -193,6 +192,7 @@
193192
"morgan": "^1.6.1",
194193
"multi-rename": "^2.0.0",
195194
"nodemon": "^3.0.1",
195+
"optimize-css-assets-webpack-plugin": "^6.0.1",
196196
"path-browserify": "^1.0.1",
197197
"philip": "^3.0.0",
198198
"place": "^1.1.4",

server/columns.spec.mjs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
import {join, dirname} from 'node:path';
1+
import {dirname} from 'node:path';
22
import {fileURLToPath} from 'node:url';
33
import fs from 'node:fs';
44
import test from 'supertape';
55
import {getColumns, isDev} from './columns.mjs';
66

77
const __filename = fileURLToPath(import.meta.url);
88
const __dirname = dirname(__filename);
9-
const distDir = join(__dirname, '..', 'dist-dev');
109

1110
test('columns: prod', (t) => {
1211
const columns = getColumns({
@@ -22,7 +21,7 @@ test('columns: dev', (t) => {
2221
isDev: true,
2322
});
2423

25-
const css = fs.readFileSync(`${distDir}/columns/name-size-date.css`, 'utf8');
24+
const css = fs.readFileSync(`${__dirname}/../css/columns/name-size-date.css`, 'utf8');
2625

2726
t.match(columns['name-size-date'], css);
2827
t.end();
@@ -33,7 +32,7 @@ test('columns: no args', (t) => {
3332
isDev(true);
3433
const columns = getColumns();
3534

36-
const css = fs.readFileSync(`${distDir}/columns/name-size-date.css`, 'utf8');
35+
const css = fs.readFileSync(`${__dirname}/../css/columns/name-size-date.css`, 'utf8');
3736
isDev(currentIsDev);
3837

3938
t.match(columns['name-size-date'], css);

server/themes.spec.mjs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
1-
import {dirname, join} from 'node:path';
1+
import {dirname} from 'node:path';
22
import {fileURLToPath} from 'node:url';
33
import fs from 'node:fs';
44
import test from 'supertape';
55
import {getThemes, isDev} from './theme.mjs';
66

77
const __filename = fileURLToPath(import.meta.url);
88
const __dirname = dirname(__filename);
9-
const distDir = join(__dirname, '..', 'dist-dev');
109

1110
test('themes: dev', (t) => {
1211
const themes = getThemes({
1312
isDev: true,
1413
});
1514

16-
const css = fs.readFileSync(`${distDir}/themes/dark.css`, 'utf8');
15+
const css = fs.readFileSync(`${__dirname}/../css/themes/dark.css`, 'utf8');
1716
const result = themes.dark.includes(css);
1817

1918
t.ok(result);
@@ -25,7 +24,7 @@ test('themes: no args', (t) => {
2524
isDev(true);
2625
const themes = getThemes();
2726

28-
const css = fs.readFileSync(`${distDir}/themes/light.css`, 'utf8');
27+
const css = fs.readFileSync(`${__dirname}/../css/themes/light.css`, 'utf8');
2928
isDev(currentIsDev);
3029

3130
t.match(themes.light, css);

0 commit comments

Comments
 (0)