mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 02:35:49 +00:00
feature: cloudcmd: optimize-css-assets-webpack-plugin -> css-minimizer-webpack-plugin
This commit is contained in:
parent
4b8568b264
commit
8200874912
5 changed files with 22 additions and 13 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import {dirname} from 'node:path';
|
||||
import {join, dirname} from 'node:path';
|
||||
import {fileURLToPath} from 'node:url';
|
||||
import fs from 'node:fs';
|
||||
import test from 'supertape';
|
||||
|
|
@ -6,6 +6,7 @@ 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({
|
||||
|
|
@ -21,7 +22,7 @@ test('columns: dev', (t) => {
|
|||
isDev: true,
|
||||
});
|
||||
|
||||
const css = fs.readFileSync(`${__dirname}/../css/columns/name-size-date.css`, 'utf8');
|
||||
const css = fs.readFileSync(`${distDir}/columns/name-size-date.css`, 'utf8');
|
||||
|
||||
t.match(columns['name-size-date'], css);
|
||||
t.end();
|
||||
|
|
@ -32,7 +33,7 @@ test('columns: no args', (t) => {
|
|||
isDev(true);
|
||||
const columns = getColumns();
|
||||
|
||||
const css = fs.readFileSync(`${__dirname}/../css/columns/name-size-date.css`, 'utf8');
|
||||
const css = fs.readFileSync(`${distDir}/columns/name-size-date.css`, 'utf8');
|
||||
isDev(currentIsDev);
|
||||
|
||||
t.match(columns['name-size-date'], css);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import {dirname} from 'node:path';
|
||||
import {dirname, join} from 'node:path';
|
||||
import {fileURLToPath} from 'node:url';
|
||||
import fs from 'node:fs';
|
||||
import test from 'supertape';
|
||||
|
|
@ -6,13 +6,14 @@ 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(`${__dirname}/../css/themes/dark.css`, 'utf8');
|
||||
const css = fs.readFileSync(`${distDir}/themes/dark.css`, 'utf8');
|
||||
const result = themes.dark.includes(css);
|
||||
|
||||
t.ok(result);
|
||||
|
|
@ -24,7 +25,7 @@ test('themes: no args', (t) => {
|
|||
isDev(true);
|
||||
const themes = getThemes();
|
||||
|
||||
const css = fs.readFileSync(`${__dirname}/../css/themes/light.css`, 'utf8');
|
||||
const css = fs.readFileSync(`${distDir}/themes/light.css`, 'utf8');
|
||||
isDev(currentIsDev);
|
||||
|
||||
t.match(themes.light, css);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue