Skip to content

Commit

Permalink
deps: upgrade example to use Parcel v2
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
agilgur5 committed Apr 20, 2022
1 parent d0c672e commit 646b4b3
Show file tree
Hide file tree
Showing 7 changed files with 10,634 additions and 19,026 deletions.
2 changes: 1 addition & 1 deletion .gitignore
@@ -1,7 +1,7 @@
### custom ###

# parcel cache
.cache/
.parcel-cache/
# build output
dist/
# test coverage output
Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -107,7 +107,7 @@ The API methods are _mostly_ just wrappers around [`signature_pad`'s API](https:

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

1. Run `npm start` and navigate to [http://localhost:8080/](http://localhost:8080/).<br>
1. Run `npm start` and navigate to [http://localhost:1234/](http://localhost:1234/).<br>
Hosted locally via the [`example/`](example/) directory
1. [View the live demo here](https://agilgur5.github.io/react-signature-canvas/).<br>
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/)
Expand Down
2 changes: 1 addition & 1 deletion example/public/index.html
Expand Up @@ -4,6 +4,6 @@
</head>
<body>
<div id='container'></div>
<script src='../src/index.js'></script>
<script type='module' src='../src/index.js'></script>
</body>
</html>
2 changes: 1 addition & 1 deletion example/src/index.js
Expand Up @@ -3,7 +3,7 @@ import ReactDOM from 'react-dom'

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

import styles from './styles.module.css'
import * as styles from './styles.module.css'

class App extends Component {
state = { trimmedDataURL: null }
Expand Down

0 comments on commit 646b4b3

Please sign in to comment.