add webpack project

This commit is contained in:
wangzhichao
2022-06-06 09:17:17 +08:00
parent c0f2662c8a
commit 08d6f0e391
3 changed files with 34 additions and 1 deletions

2
.gitignore vendored
View File

@@ -42,7 +42,7 @@ package-lock.json
# Third-part Files #
**/node_modules/*
dist/node_modules/*
webpack/*
webpack/node_modules/*
**/bower_components/*
**/src/vendors/*

16
webpack/package.json Normal file
View File

@@ -0,0 +1,16 @@
{
"name": "dist",
"version": "1.0.0",
"description": "",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "webpack"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"webpack": "^5.70.0",
"webpack-cli": "^4.9.2"
}
}

17
webpack/webpack.config.js Normal file
View File

@@ -0,0 +1,17 @@
const path = require("path");
const resolve = (dir) => path.join(__dirname, dir);
module.exports = {
entry: {
address_parse: [
"../dist/pcasCode.js",
"../dist/zipCode.js",
"../dist/address_parse.js",
],
},
output: {
filename: "[name].min.js",
path: resolve("../dist/min"),
clean: true,
},
};