1
1
import merge from 'lodash.merge' ;
2
- import { findUpSync } from 'find-up' ;
3
- import chalk from 'chalk' ;
4
2
import { createRequire } from 'module' ;
5
- import { withTrailingSlash , withoutTrailingSlash , withLeadingSlash } from '../utils/index.js' ;
6
3
7
4
const require = createRequire ( import . meta. url ) ;
8
5
@@ -14,7 +11,7 @@ const require = createRequire(import.meta.url);
14
11
export default function tailwindcss ( options = { } ) {
15
12
return {
16
13
name : 'tailwindcss' ,
17
- async handler ( config , { extendWebpack, extendBrowsersync , isDev } ) {
14
+ async handler ( config , { extendWebpack, isDev } ) {
18
15
const configPath = config . PATH ;
19
16
20
17
const opts = merge (
@@ -25,30 +22,6 @@ export default function tailwindcss(options = {}) {
25
22
options ,
26
23
) ;
27
24
28
- if ( isDev ) {
29
- const { default : createServer } = await import ( 'tailwind-config-viewer/server/index.js' ) ;
30
- await extendBrowsersync ( config , async ( bsConfig ) => {
31
- const tailwindConfigViewerServer = createServer ( {
32
- tailwindConfigProvider : ( ) =>
33
- require ( findUpSync ( [ 'tailwind.config.js' , 'tailwind.config.cjs' ] ) ) ,
34
- } ) . asMiddleware ( ) ;
35
-
36
- bsConfig . middleware = bsConfig . middleware || [ ] ;
37
- bsConfig . middleware . push ( {
38
- route : withLeadingSlash ( withoutTrailingSlash ( opts . configViewerPath ) ) ,
39
- handle : tailwindConfigViewerServer ,
40
- } ) ;
41
-
42
- bsConfig . infos = bsConfig . infos || [ ] ;
43
- bsConfig . infos . push (
44
- ( url ) =>
45
- `Tailwind Viewer runnning at ${ chalk . blue (
46
- withTrailingSlash ( url + opts . configViewerPath ) ,
47
- ) } `,
48
- ) ;
49
- } ) ;
50
- }
51
-
52
25
await extendWebpack ( config , async ( webpackConfig ) => {
53
26
const tailwind = opts . path
54
27
? opts . path
0 commit comments