找不到Javascript模块(Chrome)

时间:2018-10-27 00:36:31

标签: arrays import export

我正在尝试在纯JS中使用导入/导出来练习模块,但是遇到了错误。我的应用程序架构是:

  • app.js
  • endpoints.js
  • index.html

index.html 内部:

<script type="module" src="app.js">

app.js 内部:

import * as ENDPOINTS from './endpoints.js';

endpoints.js 内部:

export const ENDPOINTS = { POSTS : 'https://jsonplaceholder.typicode.com/posts' }

Chrome浏览器开发工具还看不到 app.js

我的问题是:我如何导入/导出或向<script>标签添加sth才能使它正常工作?

0 个答案:

没有答案