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

Build to ESM: auto add .js extension #103

Open
mantou132 opened this issue Dec 12, 2023 · 2 comments
Open

Build to ESM: auto add .js extension #103

mantou132 opened this issue Dec 12, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@mantou132
Copy link
Owner

mantou132 commented Dec 12, 2023

直接支持浏览器 module 加载

type: "module"

  • 手动添加 .js 扩展名
  • ts 自定义 transform
  • 脚本替换
@mantou132 mantou132 added the enhancement New feature or request label Dec 12, 2023
@mantou132
Copy link
Owner Author

不从裸模块导入:

import { html, render } from 'lit-html/xxx.js';
import { GemElement, html } from '@mantou/gem/lib/element.js';
import './use.js';

export { guard } from 'lit-html/directives/guard.js';

浏览器使用:

{
  "imports": {
    "lit-html/": "xxxxx/",
    "@mantou/gem/": "xxxx/"
  }
}

@mantou132
Copy link
Owner Author

WICG/import-maps#7

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

No branches or pull requests

1 participant