This repository has been archived by the owner on Jan 14, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
16 changed files
with
202 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,5 +8,6 @@ | |
LICENSE text | ||
*.md text | ||
*.js text | ||
*.ts text | ||
*.json text | ||
*.yml text |
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,21 @@ | ||
|
||
declare module 'three/examples/js/controls/OrbitControls' { | ||
export const OrbitControls: typeof THREE.OrbitControls; | ||
} | ||
|
||
declare module 'three/examples/js/loaders/OBJLoader' { | ||
export const OBJLoader: typeof THREE.OBJLoader; | ||
} | ||
|
||
declare module 'three/examples/js/postprocessing/EffectComposer' { | ||
export const EffectComposer: typeof THREE.EffectComposer; | ||
export const Pass: typeof THREE.Pass; | ||
} | ||
|
||
declare module 'three/examples/js/postprocessing/RenderPass' { | ||
export const RenderPass: typeof THREE.RenderPass; | ||
} | ||
|
||
declare module 'three/examples/js/shaders/CopyShader' { | ||
export const CopyShader: typeof THREE.CopyShader; | ||
} |
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,30 @@ | ||
'use strict'; | ||
const {getOptions} = require('loader-utils'); | ||
|
||
|
||
function Loader(source){ | ||
const options = getOptions(this); | ||
let code = `'use strict';\nvar THREE = require('three');\n`; | ||
|
||
const optionsRequires = options.requires; | ||
if (Array.isArray(optionsRequires)){ | ||
code += optionsRequires.map(moduleId => `require(${JSON.stringify(moduleId)});`).join('\n'); | ||
} | ||
|
||
code += `${source}\n`; | ||
|
||
const optionsExports = options.exports; | ||
if ((typeof optionsExports === 'object') && (optionsExports !== null)){ | ||
const lines = []; | ||
for (const id in optionsExports){ | ||
const exportId = optionsExports[id]; | ||
lines.push(`${JSON.stringify(id)}: ${exportId}`); | ||
} | ||
code += 'module.exports = {' + lines.join(',') + '}'; // eslint-disable-line prefer-template | ||
} | ||
|
||
return code; | ||
} | ||
|
||
|
||
module.exports = Loader; |
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,6 @@ | ||
import {CopyShader} from 'three/examples/js/shaders/CopyShader'; | ||
|
||
const $div = document.createElement('div'); | ||
$div.setAttribute('id', 'fixture'); | ||
$div.innerText = `${typeof CopyShader} ${typeof CopyShader.uniforms} ${typeof CopyShader.vertexShader} ${typeof CopyShader.fragmentShader}`; | ||
document.body.appendChild($div); |
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,7 @@ | ||
import {Vector3} from 'three'; | ||
import {EffectComposer, Pass} from 'three/examples/js/postprocessing/EffectComposer'; | ||
|
||
const $div = document.createElement('div'); | ||
$div.setAttribute('id', 'fixture'); | ||
$div.innerText = ` ${typeof Vector3} ${typeof EffectComposer} ${typeof Pass}`; | ||
document.body.appendChild($div); |
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,7 @@ | ||
import {Vector3} from 'three'; | ||
import {RenderPass} from 'three/examples/js/postprocessing/RenderPass'; | ||
|
||
const $div = document.createElement('div'); | ||
$div.setAttribute('id', 'fixture'); | ||
$div.innerText = ` ${typeof Vector3} ${typeof RenderPass}`; | ||
document.body.appendChild($div); |
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,7 @@ | ||
import {Vector3} from 'three'; | ||
import {RenderPass} from 'three/examples/js/postprocessing/RenderPass'; | ||
|
||
const $div: HTMLDivElement = document.createElement('div'); | ||
$div.setAttribute('id', 'fixture'); | ||
$div.innerText = ` ${typeof Vector3} ${typeof RenderPass}`; | ||
document.body.appendChild($div); |
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,8 @@ | ||
import {Vector3} from 'three'; | ||
import {OrbitControls} from 'three/examples/js/controls/OrbitControls'; | ||
import {OBJLoader} from 'three/examples/js/loaders/OBJLoader'; | ||
|
||
const $div: HTMLDivElement = document.createElement('div'); | ||
$div.setAttribute('id', 'fixture'); | ||
$div.innerText = `${typeof Vector3} ${typeof OBJLoader} ${typeof OrbitControls}`; | ||
document.body.appendChild($div); |
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
2 changes: 1 addition & 1 deletion
2
test/fixtures/wrong-examples.js.js → test/fixtures/wrong-examples.js
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,21 @@ | ||
{ | ||
"compilerOptions": { | ||
"moduleResolution": "node", | ||
"newLine": "LF", | ||
"alwaysStrict": true, | ||
"noEmitOnError": true, | ||
"noImplicitAny": true, | ||
"noImplicitReturns": true, | ||
"noImplicitThis": true, | ||
"noUnusedLocals": true, | ||
"noUnusedParameters": true, | ||
"strictNullChecks": true, | ||
"preserveConstEnums": true, | ||
"removeComments": true, | ||
"sourceMap": true, | ||
"module": "esnext", | ||
"target": "es5", | ||
"lib": ["es2017", "dom"], | ||
"allowJs": true | ||
} | ||
} |