Inflearn Community Q&A
웹팩 컴파일 에러가 납니다
Written on
·
3.3K
0
npm start를 하면 아래와 같이 에러가 나옵니다.
어떤걸 수정하면 될까요?
Html Webpack Plugin:
Error: Child compilation failed:
Module build failed: Error: ENOENT: no such file or directory, open 'D:\tstory _skin\MyApp\node_modules\@tidory\my-package.pug'
- index.js:69 Function.read
[MyApp]/[pug-load]/index.js:69:13
- index.js:147 Object.read
[MyApp]/[pug]/lib/index.js:147:25
- index.js:24
[MyApp]/[pug-load]/index.js:24:25
- index.js:23 walkAST
[MyApp]/[pug-walk]/index.js:23:18
- index.js:104
[MyApp]/[pug-walk]/index.js:104:20
- Array.reduce
- index.js:103 walkAndMergeNodes
[MyApp]/[pug-walk]/index.js:103:18
- Error: ENOENT: no such file or directory, open 'D:\tstory_skin\MyApp\node_mo dules\@tidory\my-package.pug'
- compiler.js:79 childCompiler.runAsChild
[MyApp]/[html-webpack-plugin]/lib/compiler.js:79:16
- Compiler.js:300 compile
[MyApp]/[webpack]/lib/Compiler.js:300:11
- Compiler.js:510 applyPluginsAsync.err
[MyApp]/[webpack]/lib/Compiler.js:510:14
- Tapable.js:202 next
[MyApp]/[webpack]/[tapable]/lib/Tapable.js:202:11
- CachePlugin.js:78 Compiler.
[MyApp]/[webpack]/lib/CachePlugin.js:78:5
- Tapable.js:206 Compiler.applyPluginsAsyncSeries
[MyApp]/[webpack]/[tapable]/lib/Tapable.js:206:13
- Compiler.js:507 compilation.seal.err
[MyApp]/[webpack]/lib/Compiler.js:507:11
- Tapable.js:195 Compilation.applyPluginsAsyncSeries
[MyApp]/[webpack]/[tapable]/lib/Tapable.js:195:46
- Compilation.js:683 applyPluginsAsync.err
[MyApp]/[webpack]/lib/Compilation.js:683:19
- Tapable.js:195 Compilation.applyPluginsAsyncSeries
[MyApp]/[webpack]/[tapable]/lib/Tapable.js:195:46
Answer 1
0
* 사용하시는 티도리의 버전은 항상 최신으로 유지하는 것이 좋습니다.
패키지를 제작하시는 건가요?
아니면 기본 프로젝트 템플릿을 사용하시나요?
먼저, 소스코드에 패키지를 포함하는 코드가 있는지 살펴봐주세요.
include @tidory/my-package
해당 에러는 NPM 패키지의 형태로 제작된 티도리 패키지,
@tidory/my-package 를 못찾을 때 나타납니다.
* 패키지 제작
티도리 패키지를 제작하시려면, 자세한 사항은 아래의 링크를 참고해주시면 됩니다.
https://tidory.com/docs/package/
퍼그 템플릿을 포함한 npm 패키지가 프로젝트에서 티도리 패키지로 동작하려면,
먼저 1. 패키지를 제작하고, 2. 코드 저장소에 올린 뒤, 3. 경로를 package.json 에 추가하고서
npm install 과 같은 명령으로 설치하면, node_modules/@tidory 아래에 추가됩니다.
티도리 패키지를 깃허브에 올렸다고 가정했을 때, 프로젝트의 package.json 에 티도리 패키지를 추가하려면,
프로젝트 템플릿을 참고하여 아래와 같이 추가하실 수 있습니다.
"dependencies": {
"@tidory/default-header": "github:tidory/default-header"
}
또는
npm install tidory/default-header
--
이렇게 추가된 티도리 패키지를 설치하면, 코드에서 다음과 같이 포함할 수 있습니다.
include @tidory/default-header
이렇게 소스코드에서 사용되면, 아래의 경로에 있는 퍼그 템플릿을 참고합니다.
node_modules/@tidory/default-header/index.pug
* 기본 프로젝트 템플릿
티도리 기본 프로젝트 템플릿에는 @tidory/my-package 패키지가 등록되어 있지 않습니다.





