# 커스텀 테마/플러그인에 npm 패키지 설치 방법

**URL:** https://meta.discourse.org/t/how-to-install-npm-packages-in-custom-themes-plugins/142695
**Category:** Development
**Created:** [2월 26, 2020, 5:01오후 UTC](https://meta.discourse.org/t/how-to-install-npm-packages-in-custom-themes-plugins/142695 "2020-02-26T17:01:23Z")
**Posts on this page:** 1
**Showing post:** 7

<div class="post-metadata">

### Author: ![pmusaraj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pmusaraj/32/119489_2.png) [@pmusaraj](https://meta.discourse.org/u/pmusaraj)
#### Post date: [5월 20, 2020, 1:46오전 UTC](https://meta.discourse.org/t/how-to-install-npm-packages-in-custom-themes-plugins/142695/7 "2020-05-20T01:46:36Z")

</div>

이 작업을 수행하는 더 나은 방법은 `content securty policy script src` 사이트 설정이나 테마 컴포넌트에서 해당 특정 URL을 화이트리스트에 추가하는 것입니다. 자세한 내용은 [Content Security Policy를 사용하여 XSS 공격 완화하기](https://meta.discourse.org/t/mitigate-xss-attacks-with-content-security-policy/104243)를 참고하세요.

또한 `import loadScript from "discourse/lib/load-script";`를 가져온 후 이를 사용하여 외부 스크립트를 로드할 수 있습니다(자신의 addScript 인젝터를 정의하는 대신).

---

_[View the full topic](https://meta.discourse.org/t/how-to-install-npm-packages-in-custom-themes-plugins/142695)._
