Skip to content

Commit 0361755

Browse files
committed
(refactor/deps): use parcel instead of webpack for example
- finally nix webpack@1 and babel@6 from the codebase - remove babel@6 presets, add @babel/core@7 - remove webpack loaders, parcel has built-in support for most - needed to add postcss-modules and a postcss.config.js to support the example's use of CSS modules - also fix a bunch of security warnings in the process - restructure example file hierarchy to be closer to CRA's for better standardization
1 parent 9695642 commit 0361755

File tree

8 files changed

+8382
-6814
lines changed

8 files changed

+8382
-6814
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
### custom ###
22

3+
# parcel cache
4+
.cache/
35
# build output
46
dist/
57
# test coverage output

example/index.html renamed to example/public/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
</head>
55
<body>
66
<div id='container'></div>
7-
<script src='build/bundle.js'></script>
7+
<script src='../src/index.js'></script>
88
</body>
9-
</html>
9+
</html>

example/app.js renamed to example/src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import React, { Component } from 'react'
22
import ReactDOM from 'react-dom'
33

4-
import SignaturePad from '../src/index.js'
4+
import SignaturePad from '../../src/index.js'
55

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

88
class App extends Component {
99
state = { trimmedDataURL: null }
File renamed without changes.

package-lock.json

Lines changed: 8369 additions & 6764 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@
4040
"react-signature-pad"
4141
],
4242
"scripts": {
43+
"start": "parcel example/public/index.html",
4344
"lint": "tsdx lint '**/*.js'",
4445
"lint:fix": "tsdx lint '**/*.js' --fix",
45-
"start": "webpack-dev-server -d --inline --hot",
4646
"build": "tsdx build",
4747
"test": "tsdx test",
4848
"test:pub": "npm run build && npm pack",
@@ -60,16 +60,11 @@
6060
},
6161
"devDependencies": {
6262
"@agilgur5/changelog-maker": "^3.0.0",
63+
"@babel/core": "^7.8.4",
6364
"@babel/preset-react": "^7.8.3",
6465
"@wojtekmaj/enzyme-adapter-react-17": "^0.6.6",
65-
"babel-core": "^6.26.3",
6666
"babel-eslint": "^10.0.2",
67-
"babel-loader": "^6.0.0",
68-
"babel-preset-es2015": "^6.14.0",
69-
"babel-preset-react": "^6.11.1",
70-
"babel-preset-stage-2": "^6.13.0",
7167
"canvas": "^2.9.0",
72-
"css-loader": "^0.24.0",
7368
"enzyme": "^3.10.0",
7469
"eslint": "^6.8.0",
7570
"eslint-config-standard": "^14.1.0",
@@ -80,13 +75,12 @@
8075
"eslint-plugin-standard": "^4.0.1",
8176
"jest-environment-jsdom-fifteen": "^1.0.2",
8277
"jest-without-globals": "^0.0.2",
78+
"parcel": "^1.12.4",
79+
"postcss-modules": "^1.5.0",
8380
"react": "^17.0.2",
8481
"react-dom": "^17.0.2",
8582
"react-hot-loader": "^4.13.0",
86-
"style-loader": "^0.13.1",
8783
"tsdx": "^0.12.3",
88-
"webpack": "^1.12.2",
89-
"webpack-dev-server": "^1.10.1",
9084
"window-resizeto": "0.0.2"
9185
}
9286
}

postcss.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
modules: true
3+
}

webpack.config.js

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)