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

Support ES6 modules #187

Closed
xgqfrms opened this issue Sep 28, 2018 · 3 comments
Closed

Support ES6 modules #187

xgqfrms opened this issue Sep 28, 2018 · 3 comments
Assignees

Comments

@xgqfrms
Copy link

xgqfrms commented Sep 28, 2018

cdn & ES6 import module wanted

<!DOCTYPE html>
<html lang="zh-Hans">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <meta name="author" content="xgqfrms">
    <meta name="generator" content="VS code">
    <title>JSON5</title>
</head>

<body>
    <section>
        <h1>
            <a href="https://feiqa.xgqfrms.xyz/index.html"></a>
        </h1>
    </section>
    <!-- libs -->
    <!-- <script src="https://unpkg.com/json5@^2.0.0/dist/index.min.js"></script> -->
    <script src="./libs/json5.min.js"></script>
    <script type="module">
        // const JSON5 = require('json5'); 
        import * as JSON5 from "./libs/json5.min.js";
        // JSON5.stringify(value[, replacer[, space]]);
        // JSON5.stringify(value[, options]);
    </script>
</body>

</html>
@jordanbtucker jordanbtucker self-assigned this Sep 28, 2018
@jordanbtucker jordanbtucker changed the title cdn & ES6 import module wanted Support ES6 modules Sep 28, 2018
@jordanbtucker
Copy link
Member

jordanbtucker commented Sep 28, 2018

Thanks for reporting this.

The officially supported CDN is unpkg.com.

I've added new files at dist/index.mjs and dist/index.min.mjs that support ES6 modules.

@xgqfrms
Copy link
Author

xgqfrms commented Sep 28, 2018

@jordanbtucker THX!

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

No branches or pull requests

2 participants