Skip to content

Commit d1ce8ba

Browse files
committed
add webpack
1 parent ee69aa9 commit d1ce8ba

File tree

5 files changed

+1860
-39
lines changed

5 files changed

+1860
-39
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
.DS_Store
33
.AppleDouble
44
.LSOverride
5+
dist
56

67
# Icon must end with two \r
78
Icon

package.json

+6-3
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,27 @@
1313
"email": "[email protected]",
1414
"url": "https://www.allanchau.com"
1515
},
16-
"main": "lib/index.js",
16+
"main": "dist/index.js",
1717
"directories": {
18-
"lib": "./lib",
18+
"lib": "./dist",
1919
"test": "./test"
2020
},
2121
"repository": {
2222
"type": "git",
2323
"url": "https://github.com/allanchau/project.git"
2424
},
2525
"scripts": {
26+
"build": "webpack",
2627
"test": "jest"
2728
},
2829
"devDependencies": {
2930
"eslint-config-prettier": "^6.10.1",
3031
"husky": "^4.2.3",
3132
"jest": "^25.2.6",
3233
"lint-staged": "^10.1.1",
33-
"prettier": "2.0.2"
34+
"prettier": "2.0.2",
35+
"webpack": "^4.42.1",
36+
"webpack-cli": "^3.3.11"
3437
},
3538
"dependencies": {}
3639
}

lib/index.js src/index.js

File renamed without changes.

webpack.config.js

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
const path = require("path");
2+
3+
module.exports = {
4+
entry: "./src/index.js",
5+
mode: "production",
6+
output: {
7+
path: path.resolve(__dirname, "dist"),
8+
filename: "[name].js",
9+
},
10+
};

0 commit comments

Comments
 (0)