build(striker-ui-api): use webpack + babel (transpile) to generate output for nodejs 10

main
Tsu-ba-me 3 years ago
parent 8de0d73778
commit 10c0d7a144
  1. 2
      striker-ui-api/.gitignore
  2. 327
      striker-ui-api/out/index.js
  3. 8982
      striker-ui-api/package-lock.json
  4. 11
      striker-ui-api/package.json
  5. 29
      striker-ui-api/webpack.config.js

@ -1,2 +1,4 @@
# dependencies
node_modules
out/*LICENSE*

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

@ -3,7 +3,7 @@
"version": "0.1.0",
"description": "API for striker-ui",
"scripts": {
"build": "ncc build --out out --minify --target es2015",
"build": "webpack",
"build:clean": "rm -rf out",
"dev": "node index.js",
"rebuild": "npm run build:clean && npm run build",
@ -16,8 +16,11 @@
"multer": "^1.4.4"
},
"devDependencies": {
"@vercel/ncc": "^0.33.3",
"pkg": "^5.5.1",
"prettier": "^2.5.0"
"@babel/core": "^7.17.8",
"@babel/preset-env": "^7.16.11",
"babel-loader": "^8.2.3",
"prettier": "^2.5.0",
"webpack": "^5.70.0",
"webpack-cli": "^4.9.2"
}
}

@ -0,0 +1,29 @@
const path = require('path');
module.exports = {
entry: './index.js',
mode: 'production',
module: {
rules: [
{
exclude: /node_modules/,
test: /\.m?js$/,
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env'],
},
},
},
],
},
optimization: {
minimize: true,
},
output: {
path: path.resolve(__dirname, 'out'),
filename: 'index.js',
},
stats: 'detailed',
target: 'node10',
};
Loading…
Cancel
Save