-
Notifications
You must be signed in to change notification settings - Fork 211
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: Use shared module to build website (#2230)
- Loading branch information
1 parent
9a82784
commit ece2af5
Showing
84 changed files
with
376 additions
and
4,190 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,79 +1,4 @@ | ||
// Copied from '@docusaurus/core/lib/babel/preset' template | ||
const ESM_TARGETS = ['>0.2% and supports async-functions', 'maintained node versions', 'not dead']; | ||
|
||
"use strict"; | ||
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const tslib_1 = require("tslib"); | ||
const path_1 = tslib_1.__importDefault(require("path")); | ||
function getTransformOptions(isServer) { | ||
const absoluteRuntimePath = path_1.default.dirname(require.resolve(`@babel/runtime/package.json`)); | ||
return { | ||
// All optional newlines and whitespace will be omitted when generating code | ||
// in compact mode | ||
compact: true, | ||
presets: [ | ||
isServer | ||
? [ | ||
require.resolve('@babel/preset-env'), | ||
{ | ||
targets: { | ||
node: 16, | ||
}, | ||
}, | ||
] | ||
: [ | ||
require.resolve('@babel/preset-env'), | ||
{ | ||
targets: ESM_TARGETS, | ||
useBuiltIns: 'entry', | ||
loose: true, | ||
corejs: '3', | ||
// Do not transform modules to CJS | ||
modules: false, | ||
// Exclude transforms that make all code slower | ||
exclude: ['transform-typeof-symbol', 'transform-regenerator', 'transform-async-to-generator'], | ||
}, | ||
], | ||
require.resolve('@babel/preset-react'), | ||
require.resolve('@babel/preset-typescript'), | ||
], | ||
plugins: [ | ||
// // Polyfills the runtime needed for async/await, generators, and friends | ||
// // https://babeljs.io/docs/en/babel-plugin-transform-runtime | ||
// [ | ||
// require.resolve('@babel/plugin-transform-runtime'), | ||
// { | ||
// corejs: false, | ||
// helpers: false, | ||
// // By default, it assumes @babel/[email protected]. Since we use >7.0.0, | ||
// // better to explicitly specify the version so that it can reuse the | ||
// // helper better. See https://github.com/babel/babel/issues/10261 | ||
// // eslint-disable-next-line @typescript-eslint/no-var-requires, global-require | ||
// version: require('@babel/runtime/package.json') | ||
// .version, | ||
// regenerator: false, | ||
// useESModules: true, | ||
// // Undocumented option that lets us encapsulate our runtime, ensuring | ||
// // the correct version is used | ||
// // https://github.com/babel/babel/blob/090c364a90fe73d36a30707fc612ce037bdbbb24/packages/babel-plugin-transform-runtime/src/index.js#L35-L42 | ||
// absoluteRuntime: absoluteRuntimePath, | ||
// }, | ||
// ], | ||
// Adds syntax support for import() | ||
isServer | ||
? require.resolve('babel-plugin-dynamic-import-node') | ||
: require.resolve('@babel/plugin-syntax-dynamic-import'), | ||
], | ||
}; | ||
} | ||
function babelPresets(api) { | ||
const callerName = api.caller((caller) => caller?.name); | ||
return getTransformOptions(callerName === 'server'); | ||
} | ||
exports.default = babelPresets; | ||
module.exports = { | ||
presets: [require.resolve('@docusaurus/core/lib/babel/preset')], | ||
plugins: ["styled-components"] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
[ | ||
{ | ||
"type": "doc", | ||
"label": "Overview", | ||
"id": "index" | ||
}, | ||
{ | ||
"type": "category", | ||
"label": "Showcase", | ||
"items": [ | ||
"showcase/instancing", | ||
"showcase/persistence", | ||
"showcase/postprocessing" | ||
] | ||
}, | ||
{ | ||
"type": "category", | ||
"label": "API", | ||
"items": [ | ||
"api/animation", | ||
"api/cubemap", | ||
"api/texture-3d" | ||
] | ||
}, | ||
{ | ||
"type": "category", | ||
"label": "Tutorials", | ||
"items": [ | ||
"tutorials/hello-triangle", | ||
"tutorials/hello-cube", | ||
"tutorials/lighting", | ||
"tutorials/hello-gltf", | ||
"tutorials/two-cubes", | ||
"tutorials/instanced-cubes", | ||
"tutorials/hello-instancing", | ||
"tutorials/shader-modules", | ||
"tutorials/shader-hooks", | ||
"tutorials/transform-feedback", | ||
"tutorials/transform" | ||
] | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.