@@ -8,7 +8,6 @@ const config = require('./tasks/config');
8
8
const concat = require ( 'gulp-concat' ) ;
9
9
const minifier = require ( 'gulp-uglify/minifier' ) ;
10
10
const uglifyjs = require ( 'uglify-js' ) ;
11
- const nls = require ( 'vscode-nls-dev' ) ;
12
11
const argv = require ( 'yargs' ) . argv ;
13
12
const min = ( argv . min === undefined ) ? false : true ;
14
13
const prod = ( argv . prod === undefined ) ? false : true ;
@@ -162,23 +161,7 @@ async function generateExtensionBundle() {
162
161
await ctx . dispose ( ) ;
163
162
}
164
163
165
- function transformExtensionLocalization ( patterns ) {
166
- return gulp . src ( patterns )
167
- . pipe ( nls . rewriteLocalizeCalls ( ) )
168
- . pipe ( nls . createAdditionalLanguageFiles ( nls . coreLanguages , config . paths . project . root + '/localization/i18n' , undefined , false ) )
169
- . pipe ( srcmap . write ( '.' , { includeContent : false , sourceRoot : '../src' } ) )
170
- . pipe ( gulp . dest ( 'out/src/' ) ) ;
171
- }
172
-
173
- gulp . task ( 'ext:bundle-src' , gulp . series ( generateExtensionBundle , ( ) => transformExtensionLocalization (
174
- [
175
- 'out/src/extension.js' ,
176
- 'out/src/languageService/serviceInstallerUtil.js' ,
177
- 'out/src/telemetry/telemetryInterfaces.js' ,
178
- 'out/src/protocol.js' ,
179
- 'out/src/models/interfaces.js'
180
- ]
181
- ) ) ) ;
164
+ gulp . task ( 'ext:bundle-src' , gulp . series ( generateExtensionBundle ) ) ;
182
165
183
166
gulp . task ( 'ext:compile-src' , ( done ) => {
184
167
return gulp . src ( [
@@ -194,21 +177,17 @@ gulp.task('ext:compile-src', (done) => {
194
177
process . exit ( 1 ) ;
195
178
}
196
179
} )
197
- . pipe ( nls . rewriteLocalizeCalls ( ) )
198
- . pipe ( nls . createAdditionalLanguageFiles ( nls . coreLanguages , config . paths . project . root + '/localization/i18n' , undefined , false ) )
199
180
. pipe ( srcmap . write ( '.' , { includeContent : false , sourceRoot : '../src' } ) )
200
181
. pipe ( gulp . dest ( 'out/src/' ) ) ;
201
182
} ) ;
202
183
203
184
// Compile angular view
204
185
gulp . task ( 'ext:compile-view' , ( done ) => {
205
- return gulp . src ( [
186
+ return gulp . src ( [
206
187
config . paths . project . root + '/src/views/htmlcontent/**/*.ts' ,
207
188
config . paths . project . root + '/typings/**/*.d.ts' ] )
208
189
. pipe ( srcmap . init ( ) )
209
190
. pipe ( tsProject ( ) )
210
- . pipe ( nls . rewriteLocalizeCalls ( ) )
211
- . pipe ( nls . createAdditionalLanguageFiles ( nls . coreLanguages , config . paths . project . root + '/localization/i18n' , undefined , false ) )
212
191
. pipe ( srcmap . write ( '.' , { includeContent : false , sourceRoot : '../src' } ) )
213
192
. pipe ( gulp . dest ( 'out/src/views/htmlcontent' ) ) ;
214
193
} ) ;
@@ -220,7 +199,10 @@ async function generateReactWebviewsBundle() {
220
199
* for each entry point, to be used by the webview's HTML content.
221
200
*/
222
201
entryPoints : {
223
- mssqlwebview : 'src/reactviews/index.tsx'
202
+ 'connectionDialog' : 'src/reactviews/pages/ConnectionDialog/index.tsx' ,
203
+ 'executionPlan' : 'src/reactviews/pages/ExecutionPlan/index.tsx' ,
204
+ 'tableDesigner' : 'src/reactviews/pages/TableDesigner/index.tsx' ,
205
+ 'objectExplorerFilter' : 'src/reactviews/pages/ObjectExplorerFilter/index.tsx' ,
224
206
} ,
225
207
bundle : true ,
226
208
outdir : 'out/src/reactviews/assets' ,
@@ -240,35 +222,32 @@ async function generateReactWebviewsBundle() {
240
222
typecheckPlugin ( )
241
223
] ,
242
224
sourcemap : prod ? false : 'inline' ,
243
- metafile : ! prod ,
225
+ metafile : true ,
244
226
minify : prod ,
245
227
minifyWhitespace : prod ,
246
228
minifyIdentifiers : prod ,
229
+ format : 'esm' ,
230
+ splitting : true ,
247
231
} ) ;
248
232
249
233
const result = await ctx . rebuild ( ) ;
250
234
251
- if ( ! prod ) {
252
- /**
253
- * Generating esbuild metafile for webviews. You can analyze the metafile https://esbuild.github.io/analyze/
254
- * to see the bundle size and other details.
255
- */
256
- const fs = require ( 'fs' ) . promises ;
257
- if ( result . metafile ) {
258
- await fs . writeFile ( './webviews-metafile.json' , JSON . stringify ( result . metafile ) ) ;
259
- }
235
+ /**
236
+ * Generating esbuild metafile for webviews. You can analyze the metafile https://esbuild.github.io/analyze/
237
+ * to see the bundle size and other details.
238
+ */
239
+ const fs = require ( 'fs' ) . promises ;
240
+ if ( result . metafile ) {
241
+ await fs . writeFile ( './webviews-metafile.json' , JSON . stringify ( result . metafile ) ) ;
260
242
}
261
243
244
+
262
245
await ctx . dispose ( ) ;
263
246
}
264
247
265
248
// Compile react views
266
249
gulp . task ( 'ext:compile-reactviews' ,
267
- gulp . series ( generateReactWebviewsBundle , function transformReactWebviewsLocalization ( ) {
268
- return transformExtensionLocalization ( [
269
- 'out/react-webviews/assets/*.js' ,
270
- ] )
271
- } )
250
+ gulp . series ( generateReactWebviewsBundle )
272
251
) ;
273
252
274
253
@@ -419,9 +398,7 @@ gulp.task('ext:copy-js', () => {
419
398
// Copy the files which aren't used in compilation
420
399
gulp . task ( 'ext:copy' , gulp . series ( 'ext:copy-tests' , 'ext:copy-js' , 'ext:copy-config' , 'ext:copy-systemjs-config' , 'ext:copy-dependencies' , 'ext:copy-html' , 'ext:copy-css' , 'ext:copy-images' ) ) ;
421
400
422
- gulp . task ( 'ext:localization' , gulp . series ( 'ext:localization:generate-eng-package.nls' , 'ext:localization:xliff-to-ts' , 'ext:localization:xliff-to-json' , 'ext:localization:xliff-to-package.nls' ) ) ;
423
-
424
- gulp . task ( 'ext:build' , gulp . series ( 'ext:localization' , 'ext:copy' , 'ext:clean-library-ts-files' , 'ext:compile' , 'ext:compile-view' , 'ext:compile-reactviews' ) ) ; // removed lint before copy
401
+ gulp . task ( 'ext:build' , gulp . series ( 'ext:generate-runtime-localization-files' , 'ext:copy' , 'ext:clean-library-ts-files' , 'ext:compile' , 'ext:compile-view' , 'ext:compile-reactviews' ) ) ; // removed lint before copy
425
402
426
403
gulp . task ( 'ext:test' , async ( ) => {
427
404
let workspace = process . env [ 'WORKSPACE' ] ;
0 commit comments