File tree 4 files changed +13
-2
lines changed 4 files changed +13
-2
lines changed Original file line number Diff line number Diff line change 25
25
"html-loader" : " ^0.5.5" ,
26
26
"html-webpack-plugin" : " ^3.2.0" ,
27
27
"monaco-editor-webpack-plugin" : " ^1.8.2" ,
28
+ "node-libs-browser" : " ^2.2.1" ,
28
29
"pnp-webpack-plugin" : " ^1.5.0" ,
29
30
"prettier" : " ^1.19.1" ,
30
31
"raw-loader" : " ^4.0.0" ,
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ import TSTLWorker = require("worker-loader?name=tstl.worker.js!./tstlWorker");
8
8
// @ts -ignore
9
9
import FengariWorker = require( "worker-loader?name=fengari.worker.js!./fengariWorker" ) ;
10
10
11
- import * as tstl from "typescript-to-lua/dist/LuaAST" ;
11
+ import * as lua from "typescript-to-lua/dist/LuaAST" ;
12
12
13
13
const renderjson = require ( "renderjson" ) ;
14
14
const tstlPackageJson = require ( "typescript-to-lua/package.json" ) ;
@@ -127,7 +127,7 @@ if (container && exampleLua && astLua) {
127
127
astLua . appendChild (
128
128
renderjson . set_show_to_level ( 1 ) . set_replacer ( ( name : string , val : any ) => {
129
129
if ( name === "kind" ) {
130
- return tstl . SyntaxKind [ val ] ;
130
+ return lua . SyntaxKind [ val ] ;
131
131
}
132
132
return val ;
133
133
} ) ( event . data . luaAST ) ,
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ const HtmlWebpackPlugin = require("html-webpack-plugin");
5
5
const PnpWebpackPlugin = require ( "pnp-webpack-plugin" ) ;
6
6
7
7
const resolve = query => path . resolve ( __dirname , query ) ;
8
+ const emptyModulePath = require . resolve ( "node-libs-browser/mock/empty.js" ) ;
8
9
9
10
/** @type {import("webpack").Configuration } */
10
11
module . exports = {
@@ -56,5 +57,13 @@ module.exports = {
56
57
57
58
// Ignore pnpapi reference in patched typescript source
58
59
new webpack . IgnorePlugin ( / p n p a p i / ) ,
60
+
61
+ // Exclude `typescript` from `play_bundle` referenced from `typescript-to-lua/dist/LuaAST`
62
+ new webpack . NormalModuleReplacementPlugin ( / t y p e s c r i p t / , resource => {
63
+ const { issuer, compiler } = ( resource . resourceResolveData && resource . resourceResolveData . context ) || { } ;
64
+ if ( issuer === require . resolve ( "typescript-to-lua/dist/LuaAST" ) && compiler !== "worker" ) {
65
+ resource . resource = emptyModulePath ;
66
+ }
67
+ } ) ,
59
68
] ,
60
69
} ;
Original file line number Diff line number Diff line change @@ -6353,6 +6353,7 @@ resolve@^1.13.1:
6353
6353
html-webpack-plugin : ^3.2.0
6354
6354
monaco-editor : ^0.19.3
6355
6355
monaco-editor-webpack-plugin : ^1.8.2
6356
+ node-libs-browser : ^2.2.1
6356
6357
pnp-webpack-plugin : ^1.5.0
6357
6358
prettier : ^1.19.1
6358
6359
raw-loader : ^4.0.0
You can’t perform that action at this time.
0 commit comments