Be able to `unpkg import` preact/compat + react-redux?
See original GitHub issueThe official guide recommends react-redux: https://preactjs.com/guide/v10/upgrade-guide/#preact-redux
it also recommends import + unpkg: https://preactjs.com/guide/v10/getting-started (under https://preactjs.com/guide/v10/getting-started)
<!doctype html>
<html>
<head>
<style type="text/css">
.cell {
width: 35px;
border: 1px solid black;
}
</style>
</head>
<body>
<script type="importmap">
{
"imports": {
"preact": "https://unpkg.com/preact@10.6.6/dist/preact.module.js",
"preact/hooks": "https://unpkg.com/preact@10.6.6/hooks/dist/hooks.module.js",
"preact/compat": "https://unpkg.com/preact@10.6.6/compat/dist/compat.module.js",
"htm": "https://unpkg.com/htm?module",
"prop-types": "https://unpkg.com/prop-types@15.8.1/index.js",
"react": "https://unpkg.com/preact@10.6.6/compat/dist/compat.module.js",
"react-dom": "https://unpkg.com/preact@10.6.6/compat/dist/compat.module.js",
"react-redux": "https://unpkg.com/react-redux@7.2.6/es/index.js"
}
}
</script>
<script type="module">
import * as Preact from 'preact'
import htm from 'htm'
import * as React from 'react'
import * as ReactDOM from 'react-dom'
import * as ReactRedux from 'react-redux'
const html = htm.bind(Preact.createElement)
...
</script>
</body>
</html>
I can’t get it to work whatsoever. All sorts of import errors.
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
redux/README.md - UNPKG
21, We have a variety of resources available to help you learn Redux, ... 34, - Valentino Gagliardi's post [React Redux Tutorial for...
Read more >preact - UNPKG
preact/compat /src/index.d.ts ; 9, export as namespace React; ; 10, declare namespace React { ; 11, // Export JSX ; 12, export import...
Read more >types/react-redux/index.d.ts - UNPKG
The CDN for @types/react-redux. ... 1, // Type definitions for react-redux 7.1 ... 40, import hoistNonReactStatics = require('hoist-non-react-statics');.
Read more >react-redux/package.json - UNPKG
The CDN for react-redux. ... 14, "bugs": "https://github.com/reduxjs/react-redux/issues",. 15, "main": "./lib/index.js",. 16, "unpkg": "dist/react-redux.js" ...
Read more >react-dynamic-import/README.md - UNPKG
The CDN for react-dynamic-import. ... 161, * This loads specific module from many available. 162, * modules in the directory, using given module...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Worked flawlessly, thanks.
As far as I know / can tell, unpkg does not make ES modules out of packages that do not supply that format. You might want to look into a CDN like skypack instead: https://skypack.dev