1
- import { delay } from 'std/async/delay.ts'
2
1
import { exists } from 'std/fs/exists.ts'
3
2
import { join } from 'std/path/mod.ts'
4
3
import { assert , assertEquals } from 'std/testing/asserts.ts'
5
- import { stopEsbuild } from '../bundler/esbuild.ts'
6
4
import { Aleph } from '../server/aleph.ts'
7
5
import { computeHash } from '../server/helper.ts'
8
6
import { ensureTextFile } from '../shared/fs.ts'
@@ -30,30 +28,6 @@ Deno.test('plugin: css loader', async () => {
30
28
assert ( ! isCSS ( '/style/index.sass' ) )
31
29
} )
32
30
33
- Deno . test ( {
34
- name : 'plugin: css loader in production mode' ,
35
- fn : async ( ) => {
36
- Deno . env . set ( 'DENO_TESTING' , 'true' )
37
- const dir = await Deno . makeTempDir ( { prefix : 'aleph_plugin_testing' } )
38
- const aleph = new Aleph ( dir , 'production' )
39
- await ensureTextFile (
40
- join ( dir , '/style/index.css' ) ,
41
- 'h1 { font-size: 18px; }'
42
- )
43
- const { code } = await cssLoader ( { specifier : '/style/index.css' , } , aleph )
44
- assertEquals ( code , [
45
- 'import { applyCSS } from "https://deno.land/x/aleph/framework/core/style.ts"' ,
46
- 'export const css = "h1{font-size:18px}"' ,
47
- 'export default {}' ,
48
- 'applyCSS("/style/index.css", { css })' ,
49
- ] . join ( '\n' ) )
50
-
51
- stopEsbuild ( )
52
- await delay ( 150 ) // wait esbuild stop
53
- } ,
54
- sanitizeResources : false ,
55
- } )
56
-
57
31
Deno . test ( 'plugin: css loader with extract size option' , async ( ) => {
58
32
Deno . env . set ( 'DENO_TESTING' , 'true' )
59
33
const dir = await Deno . makeTempDir ( { prefix : 'aleph_plugin_testing' } )
@@ -78,6 +52,7 @@ Deno.test('plugin: css loader for remote external', async () => {
78
52
Deno . env . set ( 'DENO_TESTING' , 'true' )
79
53
const dir = await Deno . makeTempDir ( { prefix : 'aleph_plugin_testing' } )
80
54
const aleph = new Aleph ( dir , 'development' )
55
+ aleph . config . css . cache = false
81
56
const { code } = await cssLoader ( { specifier : 'https://esm.sh/tailwindcss/dist/tailwind.min.css' , } , aleph )
82
57
assertEquals ( code , [
83
58
'import { applyCSS } from "https://deno.land/x/aleph/framework/core/style.ts"' ,
0 commit comments