Skip to content

Commit fa9aa51

Browse files
authoredFeb 12, 2020
Remove webpack devDependencies and drop IE11 support for the homepage
1 parent 0dab72e commit fa9aa51

File tree

8 files changed

+64
-2829
lines changed

8 files changed

+64
-2829
lines changed
 

‎.gitignore

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
node_modules
33
tmp
44
lib
5-
dist
65
.DS_Store
76
.idea
8-
db.json
7+
db.json

‎__tests__/server/plural.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -703,18 +703,18 @@ describe('Server', () => {
703703
.expect(200))
704704
})
705705

706-
describe('GET /main.js', () => {
706+
describe('GET /script.js', () => {
707707
test('should respond with js', () =>
708708
request(server)
709-
.get('/main.js')
709+
.get('/script.js')
710710
.expect('Content-Type', /javascript/)
711711
.expect(200))
712712
})
713713

714-
describe('GET /main.css', () => {
714+
describe('GET /style.css', () => {
715715
test('should respond with css', () =>
716716
request(server)
717-
.get('/main.css')
717+
.get('/style.css')
718718
.expect('Content-Type', /css/)
719719
.expect(200))
720720
})

‎package-lock.json

+52-2,783
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

+3-14
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,10 @@
99
},
1010
"scripts": {
1111
"test": "npm run build && cross-env NODE_ENV=test jest && npm run lint",
12-
"start": "run-p start:**",
13-
"start:babel-node": "babel-node src/cli/bin db.json -r routes.json",
14-
"start:webpack": "webpack -d --watch",
12+
"start": "babel-node src/cli/bin db.json -r routes.json",
1513
"lint": "eslint . --ignore-path .gitignore",
1614
"fix": "npm run lint -- --fix",
17-
"build": "babel src -d lib && webpack -p",
15+
"build": "babel src -d lib",
1816
"toc": "markdown-toc -i README.md",
1917
"prepublishOnly": "npm test && npm run build && pkg-ok"
2018
},
@@ -49,10 +47,7 @@
4947
"@babel/polyfill": "^7.4.4",
5048
"@babel/preset-env": "^7.5.5",
5149
"@babel/register": "^7.5.5",
52-
"babel-loader": "^8.0.6",
53-
"clean-webpack-plugin": "^3.0.0",
5450
"cross-env": "^5.2.1",
55-
"css-loader": "^3.2.0",
5651
"eslint": "^6.3.0",
5752
"eslint-config-prettier": "^6.1.0",
5853
"eslint-config-standard": "^14.1.0",
@@ -61,24 +56,18 @@
6156
"eslint-plugin-prettier": "^3.1.0",
6257
"eslint-plugin-promise": "^4.2.1",
6358
"eslint-plugin-standard": "^4.0.1",
64-
"html-webpack-plugin": "^3.2.0",
6559
"husky": "^3.0.5",
6660
"jest": "^24.9.0",
6761
"markdown-toc": "^1.2.0",
68-
"mini-css-extract-plugin": "^0.8.0",
6962
"mkdirp": "^0.5.1",
7063
"npm-run-all": "^4.1.5",
7164
"os-tmpdir": "^2.0.0",
7265
"pkg-ok": "^2.3.1",
7366
"prettier": "^1.18.2",
74-
"promise-polyfill": "^8.1.3",
7567
"rimraf": "^3.0.0",
7668
"server-ready": "^0.3.1",
7769
"supertest": "^4.0.2",
78-
"temp-write": "^4.0.0",
79-
"webpack": "^4.39.3",
80-
"webpack-cli": "^3.3.7",
81-
"whatwg-fetch": "^3.0.0"
70+
"temp-write": "^4.0.0"
8271
},
8372
"repository": {
8473
"type": "git",

‎src/front/index.html

+3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
integrity="sha384-oS3vJWv+0UjzBfQzYUhtDYW+Pj2yciDJxpsK1OYPAYjqT085Qq/1cq5FLXAZQ7Ay"
77
crossorigin="anonymous"
88
/>
9+
<link rel="stylesheet" href="style.css" />
910
<title>JSON Server</title>
1011
</head>
1112

@@ -78,5 +79,7 @@ <h1>Documentation</h1>
7879
</p>
7980
</div>
8081
</footer>
82+
83+
<script src="script.js"></script>
8184
</body>
8285
</html>

‎src/front/index.js ‎src/front/script.js

-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
import 'promise-polyfill/src/polyfill'
2-
import 'whatwg-fetch'
3-
import './style.css'
4-
51
function ResourceItem({ name, length }) {
62
return `
73
<li>

‎src/server/defaults.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const bodyParser = require('./body-parser')
99

1010
module.exports = function(opts) {
1111
const userDir = path.join(process.cwd(), 'public')
12-
const defaultDir = path.join(__dirname, '../../dist')
12+
const defaultDir = path.join(__dirname, '../front')
1313
const staticDir = fs.existsSync(userDir) ? userDir : defaultDir
1414

1515
opts = Object.assign({ logger: true, static: staticDir }, opts)

‎webpack.config.js

-21
This file was deleted.

0 commit comments

Comments
 (0)
Please sign in to comment.