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 esm build to react-router #6455

Closed
lishengzxc opened this issue Nov 4, 2018 · 3 comments
Closed

Add esm build to react-router #6455

lishengzxc opened this issue Nov 4, 2018 · 3 comments

Comments

@lishengzxc
Copy link

Hi guys,

I want to import 'react-router' with esm in browsers,
It is not clear whether the official will provide it?

like this:

<script type="module">
import React from 'https://unpkg.com/react-ecmascript@1.2.0/react.development.mjs';
import ReactDOM from 'https://unpkg.com/react-ecmascript@1.2.0/react-dom.development.mjs';
import ReactRouter from 'https://cdn/react-router.esm.js';

// ...
</script>
@TrySound
Copy link
Contributor

TrySound commented Nov 4, 2018

@lishengzxc
Copy link
Author

lishengzxc commented Nov 4, 2018

@TrySound I think it can not use in browsers.

How can I get the following lib?

import createContext from 'create-react-context';
import warning from 'tiny-warning';
import _extends from '@babel/runtime/helpers/esm/extends';
import _inheritsLoose from '@babel/runtime/helpers/esm/inheritsLoose';
import { createMemoryHistory, createLocation, locationsAreEqual, createPath } from 'history';
import invariant from 'tiny-invariant';
import pathToRegexp from 'path-to-regexp';
import { isValidElementType } from 'react-is';
import _objectWithoutPropertiesLoose from '@babel/runtime/helpers/esm/objectWithoutPropertiesLoose';
import hoistStatics from 'hoist-non-react-statics';

@timdorr
Copy link
Member

timdorr commented Nov 5, 2018

You can use the module feature of Unpkg to do this: https://unpkg.com/react-router@4.4.0-beta.6/esm/react-router.js?module

@timdorr timdorr closed this as completed Nov 5, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Jan 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants