Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请问,nej.define如何引用node_modules里面的包? #140

Open
kangwx123456789 opened this issue Dec 22, 2020 · 1 comment
Open

请问,nej.define如何引用node_modules里面的包? #140

kangwx123456789 opened this issue Dec 22, 2020 · 1 comment

Comments

@kangwx123456789
Copy link

nej.define如何引用node_modules里面的包?

@huntbao
Copy link
Collaborator

huntbao commented Dec 26, 2020

nej 自己实现了模块加载逻辑,不建议直接去引用node_modules里面的包,可以在页面上通过 <script> 标签的方式引入,比如nei 的主页面引入方式:

<!-- @MERGE -->
<script src="/src/lib/jquery.min.js"></script>
<script src="/src/lib/editor-md/js/editormd.js"></script>
<script src="/src/lib/editor-md/plugins/link-dialog/link-dialog.js"></script>
<script src="/src/lib/editor-md/plugins/reference-link-dialog/reference-link-dialog.js"></script>
<script src="/src/lib/editor-md/plugins/image-dialog/image-dialog.js"></script>
<script src="/src/lib/editor-md/plugins/reference-link-dialog/reference-link-dialog.js"></script>
<script src="/src/lib/editor-md/plugins/code-block-dialog/code-block-dialog.js"></script>
<script src="/src/lib/editor-md/plugins/table-dialog/table-dialog.js"></script>
<script src="/src/lib/editor-md/plugins/emoji-dialog/emoji-dialog.js"></script>
<script src="/src/lib/editor-md/plugins/goto-line-dialog/goto-line-dialog.js"></script>
<script src="/src/lib/editor-md/plugins/help-dialog/help-dialog.js"></script>
<script src="/src/lib/editor-md/plugins/html-entities-dialog/html-entities-dialog.js"></script>
<script src="/src/lib/editor-md/plugins/preformatted-text-dialog/preformatted-text-dialog.js"></script>
<script src="/src/lib/highlight/highlight.min.js"></script>
<script src="/src/lib/markdown-it/dist/markdown-it.min.js"></script>
<!-- /@MERGE -->

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants