mirror of
https://github.com/MCSManager/MCSManager.git
synced 2024-11-27 06:59:54 +08:00
Feat: 新增Webpack构建打包
This commit is contained in:
parent
3c0b454355
commit
ff5d98122f
3
.gitignore
vendored
3
.gitignore
vendored
@ -17,8 +17,7 @@ data/
|
||||
dist/
|
||||
out/
|
||||
public/
|
||||
|
||||
|
||||
production/
|
||||
|
||||
# Diagnostic reports (https://nodejs.org/api/report.html)
|
||||
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
|
||||
|
797
package-lock.json
generated
797
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -6,7 +6,7 @@
|
||||
"scripts": {
|
||||
"dev": "nodemon app.js",
|
||||
"start": "ts-node ./src/app.ts",
|
||||
"build": "tsc"
|
||||
"build": "tsc && webpack --config webpack.config.js"
|
||||
},
|
||||
"homepage": "https://mcsmanager.com/",
|
||||
"author": "https://github.com/Suwings",
|
||||
@ -47,6 +47,9 @@
|
||||
"@types/uuid": "^8.3.0",
|
||||
"eslint": "^7.23.0",
|
||||
"ts-node": "^9.1.1",
|
||||
"typescript": "^4.2.4"
|
||||
"typescript": "^4.2.4",
|
||||
"webpack": "^5.73.0",
|
||||
"webpack-cli": "^4.10.0",
|
||||
"webpack-node-externals": "^3.0.0"
|
||||
}
|
||||
}
|
||||
|
15
webpack.config.js
Normal file
15
webpack.config.js
Normal file
@ -0,0 +1,15 @@
|
||||
/* eslint-disable no-undef */
|
||||
const path = require('path');
|
||||
const nodeExternals = require('webpack-node-externals')
|
||||
|
||||
module.exports = {
|
||||
mode: "production",
|
||||
entry: './dist/app.js',
|
||||
target: 'node',
|
||||
externalsPresets: { node: true }, // in order to ignore built-in modules like path, fs, etc.
|
||||
externals: [nodeExternals()], // in order to ignore all modules in node_modules folder
|
||||
output: {
|
||||
filename: 'app.js',
|
||||
path: path.resolve(__dirname, 'production'),
|
||||
},
|
||||
};
|
Loading…
Reference in New Issue
Block a user