1
+ //@ts -check
2
+ /** @typedef {import('webpack').Configuration } WebpackConfig **/
3
+
4
+ 'use strict' ;
5
+
1
6
var path = require ( "path" ) ;
2
7
3
8
function resolve ( filePath ) {
@@ -13,48 +18,50 @@ var babelOptions = {
13
18
plugins : [ "@babel/plugin-transform-runtime" ]
14
19
}
15
20
16
- module . exports = function ( env , argv ) {
21
+ module . exports = function ( env , argv ) {
17
22
var isProduction = argv . mode == "production"
18
23
console . log ( "Bundling for " + ( isProduction ? "production" : "development" ) + "..." ) ;
19
24
20
25
var ionideExperimental = ( env && env . ionideExperimental ) ;
21
26
var outputPath = ionideExperimental ? "release-exp" : "release" ;
22
27
console . log ( "Output path: " + outputPath ) ;
23
28
24
- return {
25
- target : 'node' ,
26
- mode : isProduction ? "production" : "development" ,
27
- devtool : "source-map" ,
28
- entry : './out/fsharp.js' ,
29
- output : {
30
- filename : 'fsharp.js' ,
31
- path : resolve ( './' + outputPath ) ,
32
- //library: 'IONIDEFSHARP',
33
- libraryTarget : 'commonjs2'
34
- } ,
35
- resolve : {
36
- modules : [ resolve ( "./node_modules/" ) ]
37
- } ,
38
- //externals: [nodeExternals()],
39
- externals : {
40
- // Who came first the host or the plugin ?
41
- "vscode" : "commonjs vscode" ,
42
-
43
- // Optional dependencies of ws
44
- "utf-8-validate" : "commonjs utf-8-validate" ,
45
- "bufferutil" : "commonjs bufferutil"
46
- } ,
47
- module : {
48
- rules : [
49
- {
50
- test : / \. j s $ / ,
51
- exclude : / n o d e _ m o d u l e s / ,
52
- use : {
53
- loader : 'babel-loader' ,
54
- options : babelOptions
55
- } ,
56
- }
57
- ]
58
- }
59
- } ;
29
+ /**@type WebpackConfig*/
30
+ const config = {
31
+ target : 'node' ,
32
+ mode : isProduction ? "production" : "development" ,
33
+ devtool : "source-map" ,
34
+ entry : './out/fsharp.js' ,
35
+ output : {
36
+ filename : 'fsharp.js' ,
37
+ path : resolve ( './' + outputPath ) ,
38
+ //library: 'IONIDEFSHARP',
39
+ libraryTarget : 'commonjs2'
40
+ } ,
41
+ resolve : {
42
+ modules : [ resolve ( "./node_modules/" ) ]
43
+ } ,
44
+ //externals: [nodeExternals()],
45
+ externals : {
46
+ // Who came first the host or the plugin ?
47
+ "vscode" : "commonjs vscode" ,
48
+
49
+ // Optional dependencies of ws
50
+ "utf-8-validate" : "commonjs utf-8-validate" ,
51
+ "bufferutil" : "commonjs bufferutil"
52
+ } ,
53
+ module : {
54
+ rules : [
55
+ {
56
+ test : / \. j s $ / ,
57
+ exclude : / n o d e _ m o d u l e s / ,
58
+ use : {
59
+ loader : 'babel-loader' ,
60
+ options : babelOptions
61
+ } ,
62
+ }
63
+ ]
64
+ }
65
+ } ;
66
+ return config ;
60
67
}
0 commit comments