File tree 2 files changed +4
-2
lines changed
2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ describe("PurgeCSS CLI", () => {
9
9
const testFolder = path . resolve ( __dirname , "./test_examples/cli/simple/" ) ;
10
10
it ( "should print the correct output" , async ( ) => {
11
11
const response = await asyncExec (
12
- `${ purgeCSSExecutable } --content ${ testFolder } /src/content.html ${ testFolder } /src/*.js --css ${ testFolder } /src/style.css`
12
+ `${ purgeCSSExecutable } --content ${ testFolder } /src/content.html ${ testFolder } /src/*.js --css ${ testFolder } /src/style.css --safelist className `
13
13
) ;
14
14
const result = JSON . parse ( response . stdout ) ;
15
15
expect ( result [ 0 ] . css ) . toBe ( ".hello {\n color: red;\n}\n" ) ;
Original file line number Diff line number Diff line change 5
5
default : PurgeCSS ,
6
6
defaultOptions,
7
7
setOptions,
8
+ standardizeSafelist,
8
9
} = require ( "../lib/purgecss" ) ;
9
10
10
11
async function writeCSSToFile ( filePath , css ) {
@@ -57,7 +58,8 @@ const run = async () => {
57
58
if ( program . keyframes ) options . keyframes = program . keyframes ;
58
59
if ( program . rejected ) options . rejected = program . rejected ;
59
60
if ( program . variables ) options . variables = program . variables ;
60
- if ( program . safelist ) options . safelist = program . safelist ;
61
+ if ( program . safelist )
62
+ options . safelist = standardizeSafelist ( program . safelist ) ;
61
63
if ( program . blocklist ) options . blocklist = program . blocklist ;
62
64
63
65
const purged = await new PurgeCSS ( ) . purge ( options ) ;
You can’t perform that action at this time.
0 commit comments