Skip to content

Commit

Permalink
(refactor/deps): use parcel instead of webpack for example
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
agilgur5 committed Feb 6, 2020
1 parent 8f124fe commit fdc0213
Show file tree
Hide file tree
Showing 8 changed files with 10,766 additions and 9,192 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
### custom ###

# parcel cache
.cache/
# build output
dist/
# test coverage output
Expand Down
4 changes: 2 additions & 2 deletions example/index.html → example/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
</head>
<body>
<div id='container'></div>
<script src='build/bundle.js'></script>
<script src='../src/index.js'></script>
</body>
</html>
</html>
4 changes: 2 additions & 2 deletions example/app.js → example/src/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React, { Component } from 'react'
import ReactDOM from 'react-dom'

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

import styles from './styles.cssm'
import styles from './styles.module.css'

class App extends Component {
state = { trimmedDataURL: null }
Expand Down
File renamed without changes.
19,894 changes: 10,752 additions & 9,142 deletions package-lock.json

Large diffs are not rendered by default.

17 changes: 5 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@
"react-signature-pad"
],
"scripts": {
"start": "parcel example/public/index.html",
"lint": "tsdx lint '**/*.js'",
"lint:fix": "tsdx lint '**/*.js' --fix",
"start": "webpack-dev-server -d --inline --hot",
"dist": "tsdx build",
"test": "tsdx test",
"test:pub": "npm run dist && npm pack",
Expand All @@ -57,15 +57,10 @@
},
"devDependencies": {
"@agilgur5/changelog-maker": "^3.0.0",
"@babel/core": "^7.8.4",
"@babel/preset-react": "^7.8.3",
"babel-core": "^6.26.3",
"babel-eslint": "^10.0.2",
"babel-loader": "^6.0.0",
"babel-preset-es2015": "^6.14.0",
"babel-preset-react": "^6.11.1",
"babel-preset-stage-2": "^6.13.0",
"canvas-prebuilt": "^1.6.11",
"css-loader": "^0.24.0",
"enzyme": "^3.10.0",
"enzyme-adapter-react-16": "^1.14.0",
"eslint": "^6.8.0",
Expand All @@ -76,12 +71,10 @@
"eslint-plugin-react": "^7.18.3",
"eslint-plugin-standard": "^4.0.1",
"jest-without-globals": "^0.0.2",
"parcel": "^1.12.4",
"postcss-modules": "^1.5.0",
"react": "^16.8.6",
"react-dom": "^16.8.6",
"react-hot-loader": "^1.2.7",
"style-loader": "^0.13.1",
"tsdx": "^0.12.3",
"webpack": "^1.12.2",
"webpack-dev-server": "^1.10.1"
"tsdx": "^0.12.3"
}
}
3 changes: 3 additions & 0 deletions postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
modules: true
}
34 changes: 0 additions & 34 deletions webpack.config.js

This file was deleted.

0 comments on commit fdc0213

Please sign in to comment.