Skip to content

Commit 8729f15

Browse files
committed
2 parents 3b2b74f + 4ab2019 commit 8729f15

File tree

3 files changed

+46
-32
lines changed

3 files changed

+46
-32
lines changed

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"forwardPorts": [3000],
3232
"features": {
3333
"ghcr.io/devcontainers/features/node:1": {
34-
"version": "22.12"
34+
"version": "22.15"
3535
}
3636
},
3737
"runArgs": ["--network=host"]

.stackblitzrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"installDependencies": true,
3+
"startCommand": "yarn run start",
4+
"env": {
5+
"NODE_ENV": "development",
6+
"OFFLINE_API": "indexedDB",
7+
"STACKBLITZ": "true"
8+
}
9+
}

docusaurus.config.ts

Lines changed: 36 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ const ORGANIZATION_NAME = siteConfig.gitHub?.orgName ?? 'gbsl-informatik';
4848
const PROJECT_NAME = siteConfig.gitHub?.projectName ?? 'teaching-dev';
4949
const GH_OAUTH_CLIENT_ID = process.env.GH_OAUTH_CLIENT_ID;
5050
const DEFAULT_TEST_USER = process.env.DEFAULT_TEST_USER?.trim();
51+
const RUNS_IN_STACKBLITZ = !!process.env.STACKBLITZ;
5152

5253

5354
const config: Config = applyTransformers({
@@ -92,41 +93,45 @@ const config: Config = applyTransformers({
9293
},
9394
future: {
9495
v4: true,
95-
experimental_faster: {
96-
/**
97-
* no config options for swcJsLoader so far.
98-
* Instead configure it over the jsLoader in the next step
99-
*/
100-
swcJsLoader: false,
101-
swcJsMinimizer: true,
102-
swcHtmlMinimizer: true,
103-
lightningCssMinimizer: true,
104-
rspackBundler: true,
105-
rspackPersistentCache: process.env.NETLIFY ? false : true,
106-
mdxCrossCompilerCache: true,
107-
ssgWorkerThreads: true,
108-
},
96+
experimental_faster: RUNS_IN_STACKBLITZ
97+
? false
98+
: {
99+
/**
100+
* no config options for swcJsLoader so far.
101+
* Instead configure it over the jsLoader in the next step
102+
*/
103+
swcJsLoader: false,
104+
swcJsMinimizer: true,
105+
swcHtmlMinimizer: true,
106+
lightningCssMinimizer: true,
107+
rspackBundler: true,
108+
rspackPersistentCache: process.env.NETLIFY ? false : true,
109+
mdxCrossCompilerCache: true,
110+
ssgWorkerThreads: true,
111+
},
109112
},
110113
webpack: {
111-
jsLoader: (isServer) => {
112-
const defaultOptions = require("@docusaurus/faster").getSwcLoaderOptions({ isServer });
113-
return {
114-
loader: 'builtin:swc-loader', // (only works with Rspack)
115-
options: {
116-
...defaultOptions,
117-
jsc: {
118-
parser: {
119-
...defaultOptions.jsc.parser,
120-
decorators: true
114+
jsLoader: RUNS_IN_STACKBLITZ
115+
? undefined
116+
: (isServer) => {
117+
const defaultOptions = require("@docusaurus/faster").getSwcLoaderOptions({ isServer });
118+
return {
119+
loader: 'builtin:swc-loader', // (only works with Rspack)
120+
options: {
121+
...defaultOptions,
122+
jsc: {
123+
parser: {
124+
...defaultOptions.jsc.parser,
125+
decorators: true
126+
},
127+
transform: {
128+
...defaultOptions.jsc.transform,
129+
decoratorVersion: '2022-03',
130+
}
121131
},
122-
transform: {
123-
...defaultOptions.jsc.transform,
124-
decoratorVersion: '2022-03',
125-
}
126132
},
127-
},
128-
}
129-
},
133+
}
134+
},
130135
},
131136

132137
// Even if you don't use internationalization, you can use this field to set

0 commit comments

Comments
 (0)