Skip to content

Commit 4a6895f

Browse files
authored
Ugprade playground tstl to 0.40.0 and docusaurus to beta (#52)
* Upgrade tstl to 0.40.0 * fix prettier * Upgrade docusaurus
1 parent 6f92645 commit 4a6895f

File tree

6 files changed

+17285
-22598
lines changed

6 files changed

+17285
-22598
lines changed

docusaurus-plugin.js

+15-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const path = require("path");
2-
const { DefinePlugin } = require("webpack");
2+
const { DefinePlugin, ProvidePlugin } = require("webpack");
33
const ForkTsCheckerWebpackPlugin = require("fork-ts-checker-webpack-plugin");
44
// Not used directly in playground, because it imports typescript
55
const { SyntaxKind: LuaSyntaxKind } = require("typescript-to-lua/dist/LuaAST");
@@ -10,7 +10,6 @@ const resolve = (query) => path.resolve(__dirname, query);
1010
module.exports = () => ({
1111
configureWebpack: (config, isServer) => {
1212
return {
13-
node: { fs: "empty" },
1413
resolveLoader: {
1514
// Don't generate worker files in server build, because it overrides client files
1615
alias: isServer ? { "worker-loader": require.resolve("null-loader") } : {},
@@ -25,6 +24,17 @@ module.exports = () => ({
2524
[require.resolve("monaco-editor/esm/vs/language/typescript/lib/lib.js")]: resolve(
2625
"src/monaco-typescript-lib-stub.ts",
2726
),
27+
28+
// Stub file resolution for playground
29+
[require.resolve("typescript-to-lua/dist/transpilation/resolve.js")]:
30+
resolve("src/resolve-stub.ts"),
31+
},
32+
fallback: {
33+
fs: false,
34+
buffer: require.resolve("buffer"),
35+
stream: require.resolve("stream-browserify"),
36+
zlib: require.resolve("browserify-zlib"),
37+
path: require.resolve("path-browserify"),
2838
},
2939
},
3040
module: {
@@ -45,6 +55,9 @@ module.exports = () => ({
4555
],
4656
},
4757
plugins: [
58+
new ProvidePlugin({
59+
process: "process/browser",
60+
}),
4861
new DefinePlugin({ __LUA_SYNTAX_KIND__: JSON.stringify(LuaSyntaxKind) }),
4962
...(isServer
5063
? []

0 commit comments

Comments
 (0)