Skip to content

Commit 7540b1f

Browse files
committed
deps: upgrade example to use Parcel v2
- deps: remove postcss-modules as Parcel no longer needs it - this also fixes 20+ vulns in the devDeps - use a namespace import for the CSS modules as requested in the docs: https://parceljs.org/languages/css/#css-modules - Per Migration docs (https://parceljs.org/getting-started/migration/): - use `type='module'` in `<script>` tag - use `.parcel-cache` in gitignore instead of `.cache` - misc: Babel is no longer necessary, so might move Parcel into the example dir instead, as it doesn't have to share deps now? - getting warnings from Parcel now that the Babel config is a deopt, but that's being used by Rollup (also still very fast) - misc: add `--open` to Parcel CLI script so it opens in browser window automatically
1 parent c70cc5a commit 7540b1f

File tree

7 files changed

+10634
-19026
lines changed

7 files changed

+10634
-19026
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
### custom ###
22

33
# parcel cache
4-
.cache/
4+
.parcel-cache/
55
# build output
66
dist/
77
# test coverage output

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ The API methods are _mostly_ just wrappers around [`signature_pad`'s API](https:
107107

108108
You can interact with the example in a few different ways:
109109

110-
1. Run `npm start` and navigate to [http://localhost:8080/](http://localhost:8080/).<br>
110+
1. Run `npm start` and navigate to [http://localhost:1234/](http://localhost:1234/).<br>
111111
Hosted locally via the [`example/`](example/) directory
112112
1. [View the live demo here](https://agilgur5.github.io/react-signature-canvas/).<br>
113113
Hosted via the [`gh-pages` branch](https://github.com/agilgur5/react-signature-canvas/tree/gh-pages), a standalone version of the code in [`example/`](example/)

example/public/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
</head>
55
<body>
66
<div id='container'></div>
7-
<script src='../src/index.js'></script>
7+
<script type='module' src='../src/index.js'></script>
88
</body>
99
</html>

example/src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import ReactDOM from 'react-dom'
33

44
import SignaturePad from '../../src/index.tsx'
55

6-
import styles from './styles.module.css'
6+
import * as styles from './styles.module.css'
77

88
class App extends Component {
99
state = { trimmedDataURL: null }

0 commit comments

Comments
 (0)