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

Add .js extension in the import statement of es modules. #862

Merged
merged 3 commits into from
Dec 23, 2021

Conversation

pissang
Copy link
Contributor

@pissang pissang commented Dec 23, 2021

To allow us importing ES modules in the lib folder on the browsers.

Example:

<script type="importmap">
{
    "imports": {
        "zrender/": "https://unpkg.com/zrender@latest/",
        "tslib": "https://unpkg.com/tslib@2.3.1/tslib.es6.js"
    }
}
</script>
<script type="module">
if (typeof process === 'undefined' || !process.env) {
    window.process = {
        env: {
            NODE_ENV: 'development'
        }
    };
}
import PathProxy from 'zrender/lib/core/PathProxy.js'
</script>

build/processLib.js Outdated Show resolved Hide resolved
@pissang pissang merged commit 5b75ddb into next Dec 23, 2021
@pissang pissang deleted the add-js-extension branch December 23, 2021 09:09
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

Successfully merging this pull request may close these issues.

None yet

2 participants