Skip to content

Commit fdc0213

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 8f124fe commit fdc0213

File tree

8 files changed

+10766
-9192
lines changed

8 files changed

+10766
-9192
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: 10752 additions & 9142 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@
3737
"react-signature-pad"
3838
],
3939
"scripts": {
40+
"start": "parcel example/public/index.html",
4041
"lint": "tsdx lint '**/*.js'",
4142
"lint:fix": "tsdx lint '**/*.js' --fix",
42-
"start": "webpack-dev-server -d --inline --hot",
4343
"dist": "tsdx build",
4444
"test": "tsdx test",
4545
"test:pub": "npm run dist && npm pack",
@@ -57,15 +57,10 @@
5757
},
5858
"devDependencies": {
5959
"@agilgur5/changelog-maker": "^3.0.0",
60+
"@babel/core": "^7.8.4",
6061
"@babel/preset-react": "^7.8.3",
61-
"babel-core": "^6.26.3",
6262
"babel-eslint": "^10.0.2",
63-
"babel-loader": "^6.0.0",
64-
"babel-preset-es2015": "^6.14.0",
65-
"babel-preset-react": "^6.11.1",
66-
"babel-preset-stage-2": "^6.13.0",
6763
"canvas-prebuilt": "^1.6.11",
68-
"css-loader": "^0.24.0",
6964
"enzyme": "^3.10.0",
7065
"enzyme-adapter-react-16": "^1.14.0",
7166
"eslint": "^6.8.0",
@@ -76,12 +71,10 @@
7671
"eslint-plugin-react": "^7.18.3",
7772
"eslint-plugin-standard": "^4.0.1",
7873
"jest-without-globals": "^0.0.2",
74+
"parcel": "^1.12.4",
75+
"postcss-modules": "^1.5.0",
7976
"react": "^16.8.6",
8077
"react-dom": "^16.8.6",
81-
"react-hot-loader": "^1.2.7",
82-
"style-loader": "^0.13.1",
83-
"tsdx": "^0.12.3",
84-
"webpack": "^1.12.2",
85-
"webpack-dev-server": "^1.10.1"
78+
"tsdx": "^0.12.3"
8679
}
8780
}

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 & 34 deletions
This file was deleted.

0 commit comments

Comments
 (0)