1
嘗試從舊的體系結構移動到模塊化世界,並使用npm與Three和Angular的posprocessing包。使用Angular導入模塊內部的自定義文件
當從後處理它提供了以下錯誤導入模塊:
Failed to compile.
./~/postprocessing/src/materials/adaptive-luminosity/glsl/shader.frag
Module parse failed: (...)/materials/adaptive-luminosity/glsl/shader.frag Unexpected token (1:8)
You may need an appropriate loader to handle this file type.
| uniform sampler2D tPreviousLum;
| uniform sampler2D tCurrentLum;
| uniform float minLuminance;
@ ./~/postprocessing/src/materials/adaptive-luminosity/index.js 3:0-42
@ ./~/postprocessing/src/materials/index.js
我認爲它與角CLI設置的東西。 任何想法如何啓用導入自定義文件擴展名?
進出口新的的WebPack,和排出後的角度的WebPack配置相當複雜。你能描述在哪個地方正確地插入裝載器嗎? – mjanisz1
在'loaders'下的webpack配置文件中,就像'glslify-loader'頁面建議的一樣。我會更新答案 –
這仍然只能通過彈出角度cli應用程序嗎? – daniel