@@ -9,9 +9,6 @@ import { lessLoader } from 'esbuild-plugin-less';
99import fs from 'fs-extra' ;
1010import { getZeroMQPreBuildsFoldersToKeep , getBundleConfiguration , bundleConfiguration } from '../webpack/common' ;
1111import ImportGlobPlugin from 'esbuild-plugin-import-glob' ;
12- import postcss from 'postcss' ;
13- import tailwindcss from '@tailwindcss/postcss' ;
14- import autoprefixer from 'autoprefixer' ;
1512const plugin = require ( 'node-stdlib-browser/helpers/esbuild/plugin' ) ;
1613const stdLibBrowser = require ( 'node-stdlib-browser' ) ;
1714
@@ -48,8 +45,6 @@ const commonExternals = [
4845 'vscode' ,
4946 'commonjs' ,
5047 'node:crypto' ,
51- 'node:fs/promises' ,
52- 'node:path' ,
5348 'vscode-jsonrpc' , // Used by a few modules, might as well pull this out, instead of duplicating it in separate bundles.
5449 // Ignore telemetry specific packages that are not required.
5550 'applicationinsights-native-metrics' ,
@@ -91,11 +86,7 @@ const loader: { [ext: string]: Loader } = {
9186
9287// https://github.com/evanw/esbuild/issues/20#issuecomment-802269745
9388// https://github.com/hyrious/esbuild-plugin-style
94- function style ( {
95- minify = true ,
96- charset = 'utf8' ,
97- enableTailwind = false
98- } : StylePluginOptions & { enableTailwind ?: boolean } = { } ) : Plugin {
89+ function style ( { minify = true , charset = 'utf8' } : StylePluginOptions = { } ) : Plugin {
9990 return {
10091 name : 'style' ,
10192 setup ( { onResolve, onLoad } ) {
@@ -141,32 +132,6 @@ function style({
141132 } ) ) ;
142133
143134 onLoad ( { filter : / .* / , namespace : 'style-content' } , async ( args ) => {
144- // Process with PostCSS/Tailwind if enabled and file exists
145- if ( enableTailwind && args . path . includes ( 'tailwind.css' ) && fs . existsSync ( args . path ) ) {
146- try {
147- const cssContent = await fs . readFile ( args . path , 'utf8' ) ;
148- const result = await postcss ( [ tailwindcss , autoprefixer ] ) . process ( cssContent , {
149- from : args . path ,
150- to : args . path
151- } ) ;
152-
153- const options = { ...opt , stdin : { contents : result . css , loader : 'css' } } ;
154- options . loader = options . loader || { } ;
155- // Add the same loaders we add for other places
156- Object . keys ( loader ) . forEach ( ( key ) => {
157- if ( options . loader && ! options . loader [ key ] ) {
158- options . loader [ key ] = loader [ key ] ;
159- }
160- } ) ;
161- const { errors, warnings, outputFiles } = await esbuild . build ( options ) ;
162- return { errors, warnings, contents : outputFiles ! [ 0 ] . text , loader : 'text' } ;
163- } catch ( error ) {
164- console . error ( `PostCSS processing failed for ${ args . path } :` , error ) ;
165- throw error ;
166- }
167- }
168-
169- // Default behavior for other CSS files
170135 const options = { entryPoints : [ args . path ] , ...opt } ;
171136 options . loader = options . loader || { } ;
172137 // Add the same loaders we add for other places
@@ -175,9 +140,7 @@ function style({
175140 options . loader [ key ] = loader [ key ] ;
176141 }
177142 } ) ;
178-
179143 const { errors, warnings, outputFiles } = await esbuild . build ( options ) ;
180-
181144 return { errors, warnings, contents : outputFiles ! [ 0 ] . text , loader : 'text' } ;
182145 } ) ;
183146 }
@@ -195,9 +158,7 @@ function createConfig(
195158 const plugins : Plugin [ ] = [ ] ;
196159 let define : SameShape < BuildOptions , BuildOptions > [ 'define' ] = undefined ;
197160 if ( target === 'web' ) {
198- // Enable Tailwind processing for dataframe renderer
199- const enableTailwind = source . includes ( path . join ( 'dataframe-renderer' , 'index.ts' ) ) ;
200- plugins . push ( style ( { enableTailwind } ) ) ;
161+ plugins . push ( style ( ) ) ;
201162 plugins . push ( lessLoader ( ) ) ;
202163
203164 define = {
@@ -326,16 +287,6 @@ async function buildAll() {
326287 ) ,
327288 { target : 'web' , watch : watchAll }
328289 ) ,
329- build (
330- path . join ( extensionFolder , 'src' , 'webviews' , 'webview-side' , 'dataframe-renderer' , 'index.ts' ) ,
331- path . join ( extensionFolder , 'dist' , 'webviews' , 'webview-side' , 'dataframeRenderer' , 'dataframeRenderer.js' ) ,
332- { target : 'web' , watch : isWatchMode }
333- ) ,
334- build (
335- path . join ( extensionFolder , 'src' , 'webviews' , 'webview-side' , 'vega-renderer' , 'index.ts' ) ,
336- path . join ( extensionFolder , 'dist' , 'webviews' , 'webview-side' , 'vegaRenderer' , 'vegaRenderer.js' ) ,
337- { target : 'web' , watch : isWatchMode }
338- ) ,
339290 build (
340291 path . join ( extensionFolder , 'src' , 'webviews' , 'webview-side' , 'variable-view' , 'index.tsx' ) ,
341292 path . join ( extensionFolder , 'dist' , 'webviews' , 'webview-side' , 'viewers' , 'variableView.js' ) ,
@@ -350,11 +301,6 @@ async function buildAll() {
350301 path . join ( extensionFolder , 'src' , 'webviews' , 'webview-side' , 'data-explorer' , 'index.tsx' ) ,
351302 path . join ( extensionFolder , 'dist' , 'webviews' , 'webview-side' , 'viewers' , 'dataExplorer.js' ) ,
352303 { target : 'web' , watch : watchAll }
353- ) ,
354- build (
355- path . join ( extensionFolder , 'src' , 'webviews' , 'webview-side' , 'integrations' , 'index.tsx' ) ,
356- path . join ( extensionFolder , 'dist' , 'webviews' , 'webview-side' , 'integrations' , 'index.js' ) ,
357- { target : 'web' , watch : watchAll }
358304 )
359305 ) ;
360306
0 commit comments