Skip to content

Commit f92c62d

Browse files
committed
♻️ switch from Webpack to Parcel for documentation site
1 parent 29cc7f9 commit f92c62d

9 files changed

+3338
-2194
lines changed

www/.babelrc

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
2+
"plugins": ["preval"],
23
"presets": [
3-
["env", {
4+
["@babel/preset-env", {
45
"modules": false
56
}]
67
]

www/.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
public
22
node_modules
3-
.DS_Store
3+
.DS_Store
4+
.cache

www/package.json

+14-19
Original file line numberDiff line numberDiff line change
@@ -6,45 +6,40 @@
66
"author": "Alec Lomas",
77
"license": "MIT",
88
"scripts": {
9-
"start": "webpack-dev-server",
10-
"prebuild": "node generate-colors",
11-
"build": "webpack",
12-
"prebuild:min": "cross-env NODE_ENV=production node generate-colors",
13-
"build:min": "cross-env NODE_ENV=production webpack -p"
9+
"start": "parcel src/index.html --out-dir public",
10+
"build": "parcel build src/index.html --out-dir public",
11+
"build:min": "cross-env NODE_ENV=production parcel build src/index.html --out-dir public"
1412
},
1513
"dependencies": {
14+
"@babel/core": "^7.2.0",
15+
"@babel/preset-env": "^7.2.0",
1616
"autoprefixer": "^7.1.6",
17-
"babel-core": "^6.26.0",
18-
"babel-loader": "^7.1.2",
19-
"babel-preset-env": "^1.6.1",
17+
"babel-plugin-preval": "^3.0.1",
2018
"cross-env": "^5.1.1",
21-
"css-loader": "^0.28.7",
2219
"css-mqpacker": "^6.0.1",
2320
"cssnano": "^3.10.0",
24-
"extract-text-webpack-plugin": "^3.0.2",
25-
"fs-extra": "^4.0.2",
26-
"html-webpack-plugin": "^2.30.1",
2721
"postcss": "^6.0.14",
2822
"postcss-custom-media": "^6.0.0",
2923
"postcss-import": "^11.0.0",
30-
"postcss-loader": "^2.0.8",
3124
"postcss-nested": "^2.1.2",
3225
"random-a11y-combo": "^1.0.0",
3326
"randomcolor": "^0.5.3",
34-
"style-loader": "^0.19.0",
35-
"tachyons": "^4.9.0",
36-
"webpack": "^3.8.1"
27+
"tachyons": "^4.9.0"
3728
},
3829
"devDependencies": {
3930
"eslint": "3.19.0",
4031
"eslint-config-lowmess": "1.1.0",
32+
"parcel-bundler": "^1.10.3",
4133
"prettier": "^1.8.2",
4234
"stylelint": "8.1.1",
43-
"stylelint-config-lowmess": "0.2.0",
44-
"webpack-dev-server": "^2.9.4"
35+
"stylelint-config-lowmess": "0.2.0"
4536
},
4637
"browserslist": [
4738
"last 2 versions",
4839
"> 5%"
49-
]
40+
],
41+
"alias": {
42+
"hero-patterns": "../src/hero-patterns.js",
43+
"package.json": "../package.json"
44+
}
5045
}
+5-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
const fs = require('fs-extra')
1+
// @preval
2+
23
const randomColor = require('randomcolor')
34
const combo = require('random-a11y-combo')
4-
const hero = require('../dist/hero-patterns.cjs.js')
5+
const hero = require('../../dist/hero-patterns.cjs.js')
56

6-
// create 'public', should always fire
7-
if (!fs.existsSync('public')) fs.mkdirSync('public')
87
// pre-generate color combinations
98
// this can make the build hang but speeds up the site tremendously
109
const combos = []
@@ -13,4 +12,5 @@ const colors = randomColor({ count: num })
1312
for (const color of colors) {
1413
combos.push(combo(color))
1514
}
16-
fs.outputJsonSync('./public/colors.json', combos)
15+
16+
module.exports = combos

www/src/index.html

+1
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ <h2 class="f3 fw4 mb3 mt4">Usage</h2>
8080
</ul>
8181
</div>
8282
</footer>
83+
<script src="./main.js"></script>
8384
</body>
8485

8586
</html>

www/src/main.css

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
@charset 'utf-8';
22

3-
@import 'tachyons/src/tachyons';
4-
53
@custom-media --breakpoint-not-small screen and (min-width: 48em);
64
@custom-media --breakpoint-medium screen and (min-width: 72em);
75
@custom-media --breakpoint-large screen and (min-width: 96em);

www/src/main.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
import colors from 'colors'
21
import { version } from 'package.json'
32
import * as hero from 'hero-patterns'
3+
import colors from './colors'
44

5+
import 'tachyons'
56
import './main.css'
67

78
// Add version number to header

www/webpack.config.js

-48
This file was deleted.

0 commit comments

Comments
 (0)