mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-22 18:29:26 +00:00
feature: cloudcmd: revert: optimize-css-assets-webpack-plugin -> css-minimizer-webpack-plugin: broken spinner
This reverts commit 8200874912.
This commit is contained in:
parent
ed31dd2409
commit
8f52376d3f
5 changed files with 13 additions and 22 deletions
|
|
@ -1,13 +1,19 @@
|
|||
'use strict';
|
||||
|
||||
const {env} = require('node:process');
|
||||
|
||||
const OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin');
|
||||
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
||||
|
||||
const isDev = env.NODE_ENV === 'development';
|
||||
|
||||
const clean = (a) => a.filter(Boolean);
|
||||
|
||||
const plugins = clean([
|
||||
new MiniCssExtractPlugin({
|
||||
filename: '[name].css',
|
||||
}),
|
||||
!isDev && new OptimizeCssAssetsPlugin(),
|
||||
]);
|
||||
|
||||
const rules = [{
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ const {
|
|||
} = require('webpack');
|
||||
|
||||
const WebpackBar = require('webpackbar');
|
||||
const CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
|
||||
|
||||
const modules = './modules';
|
||||
const dirModules = './client/modules';
|
||||
|
|
@ -106,18 +105,6 @@ module.exports = {
|
|||
devtool,
|
||||
optimization: {
|
||||
splitChunks,
|
||||
minimize: true,
|
||||
minimizer: [
|
||||
new CssMinimizerPlugin({
|
||||
minimizerOptions: {
|
||||
preset: ['default', {
|
||||
discardComments: {
|
||||
removeAll: true,
|
||||
},
|
||||
}],
|
||||
},
|
||||
}),
|
||||
],
|
||||
},
|
||||
entry: {
|
||||
'themes/dark': `${dirThemes}/dark.css`,
|
||||
|
|
|
|||
|
|
@ -168,7 +168,6 @@
|
|||
"clean-css-loader": "^4.2.1",
|
||||
"codegen.macro": "^4.0.0",
|
||||
"css-loader": "^7.1.2",
|
||||
"css-minimizer-webpack-plugin": "^7.0.2",
|
||||
"css-modules-require-hook": "^4.2.3",
|
||||
"domtokenlist-shim": "^1.2.0",
|
||||
"emitify": "^4.0.1",
|
||||
|
|
@ -193,6 +192,7 @@
|
|||
"morgan": "^1.6.1",
|
||||
"multi-rename": "^2.0.0",
|
||||
"nodemon": "^3.0.1",
|
||||
"optimize-css-assets-webpack-plugin": "^6.0.1",
|
||||
"path-browserify": "^1.0.1",
|
||||
"philip": "^3.0.0",
|
||||
"place": "^1.1.4",
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import {join, dirname} from 'node:path';
|
||||
import {dirname} from 'node:path';
|
||||
import {fileURLToPath} from 'node:url';
|
||||
import fs from 'node:fs';
|
||||
import test from 'supertape';
|
||||
|
|
@ -6,7 +6,6 @@ import {getColumns, isDev} from './columns.mjs';
|
|||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = dirname(__filename);
|
||||
const distDir = join(__dirname, '..', 'dist-dev');
|
||||
|
||||
test('columns: prod', (t) => {
|
||||
const columns = getColumns({
|
||||
|
|
@ -22,7 +21,7 @@ test('columns: dev', (t) => {
|
|||
isDev: true,
|
||||
});
|
||||
|
||||
const css = fs.readFileSync(`${distDir}/columns/name-size-date.css`, 'utf8');
|
||||
const css = fs.readFileSync(`${__dirname}/../css/columns/name-size-date.css`, 'utf8');
|
||||
|
||||
t.match(columns['name-size-date'], css);
|
||||
t.end();
|
||||
|
|
@ -33,7 +32,7 @@ test('columns: no args', (t) => {
|
|||
isDev(true);
|
||||
const columns = getColumns();
|
||||
|
||||
const css = fs.readFileSync(`${distDir}/columns/name-size-date.css`, 'utf8');
|
||||
const css = fs.readFileSync(`${__dirname}/../css/columns/name-size-date.css`, 'utf8');
|
||||
isDev(currentIsDev);
|
||||
|
||||
t.match(columns['name-size-date'], css);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import {dirname, join} from 'node:path';
|
||||
import {dirname} from 'node:path';
|
||||
import {fileURLToPath} from 'node:url';
|
||||
import fs from 'node:fs';
|
||||
import test from 'supertape';
|
||||
|
|
@ -6,14 +6,13 @@ import {getThemes, isDev} from './theme.mjs';
|
|||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = dirname(__filename);
|
||||
const distDir = join(__dirname, '..', 'dist-dev');
|
||||
|
||||
test('themes: dev', (t) => {
|
||||
const themes = getThemes({
|
||||
isDev: true,
|
||||
});
|
||||
|
||||
const css = fs.readFileSync(`${distDir}/themes/dark.css`, 'utf8');
|
||||
const css = fs.readFileSync(`${__dirname}/../css/themes/dark.css`, 'utf8');
|
||||
const result = themes.dark.includes(css);
|
||||
|
||||
t.ok(result);
|
||||
|
|
@ -25,7 +24,7 @@ test('themes: no args', (t) => {
|
|||
isDev(true);
|
||||
const themes = getThemes();
|
||||
|
||||
const css = fs.readFileSync(`${distDir}/themes/light.css`, 'utf8');
|
||||
const css = fs.readFileSync(`${__dirname}/../css/themes/light.css`, 'utf8');
|
||||
isDev(currentIsDev);
|
||||
|
||||
t.match(themes.light, css);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue