Browse Source

Bundle babel-polyfill #18

pull/1/head
Alexey Velikiy 7 years ago
parent
commit
d02609d1ec
  1. 1
      server/BUILD_6_14.md
  2. 29
      server/build/webpack.614.prod.conf.js
  3. 42361
      server/dist/server.js
  4. 19
      server/package.json

1
server/BUILD_6_14.md

@ -4,7 +4,6 @@ If you want to use old version of Node.js, then do:
``` ```
cd server cd server
npm run 6-14-install
npm run 6-14-build npm run 6-14-build
npm run 6-14-start npm run 6-14-start
``` ```

29
server/build/webpack.614.prod.conf.js

@ -0,0 +1,29 @@
const path = require('path');
const fs = require('fs');
const webpack = require('webpack');
module.exports = {
mode: 'production',
target: 'node',
node: {
__dirname: false,
__filename: false,
},
entry: [ 'babel-polyfill', './dist/server.js' ],
output: {
filename: "server-6-14.js",
path: path.join(__dirname, '../dist')
},
module: {
rules: [
{
test: /\.js$/,
use: [
{ loader: 'babel-loader' }
]
}
]
}
}

42361
server/dist/server.js vendored

File diff suppressed because one or more lines are too long

19
server/package.json

@ -6,12 +6,8 @@
"start": "node dist/server.js", "start": "node dist/server.js",
"dev": "node build/dev-server.js", "dev": "node build/dev-server.js",
"build": "webpack --config build/webpack.prod.conf.js", "build": "webpack --config build/webpack.prod.conf.js",
"6-14-start": "node dist/server-6-14.js", "6-14-start": "node dist/server-6-14.js",
"6-14-install": "npm install && npm install babel-cli", "6-14-build": "npm run build && webpack --config build/webpack.614.prod.conf.js"
"6-14-copyserver": "echo \"require('babel-polyfill'); \" > dist/server-6-14-prebuild.js && cat dist/server.js >> dist/server-6-14-prebuild.js",
"6-14-prebuild": "npm run build && npm run 6-14-copyserver",
"6-14-build": "npm run 6-14-prebuild && babel --presets es2015 dist/server-6-14-prebuild.js -o dist/server-6-14.js && rm dist/server-6-14-prebuild.js"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
@ -24,19 +20,20 @@
}, },
"homepage": "https://github.com/hastic/hastic-server#readme", "homepage": "https://github.com/hastic/hastic-server#readme",
"dependencies": { "dependencies": {
"axios": "^0.18.0",
"es6-promise": "^4.2.4",
"event-stream": "^3.3.4",
"koa": "^2.5.1",
"koa-bodyparser": "^4.2.1",
"koa-router": "^7.4.0"
}, },
"devDependencies": { "devDependencies": {
"@types/koa": "^2.0.45", "@types/koa": "^2.0.45",
"@types/koa-bodyparser": "^4.2.0", "@types/koa-bodyparser": "^4.2.0",
"@types/koa-router": "^7.0.28", "@types/koa-router": "^7.0.28",
"axios": "^0.18.0",
"es6-promise": "^4.2.4",
"event-stream": "^3.3.4",
"koa": "^2.5.1",
"koa-bodyparser": "^4.2.1",
"koa-router": "^7.4.0",
"babel-core": "^6.26.3", "babel-core": "^6.26.3",
"babel-loader": "^7.1.4", "babel-loader": "^7.1.4",
"babel-polyfill": "^6.26.0",
"babel-preset-env": "^1.7.0", "babel-preset-env": "^1.7.0",
"babel-preset-es2015": "^6.24.1", "babel-preset-es2015": "^6.24.1",
"nodemon": "^1.17.5", "nodemon": "^1.17.5",

Loading…
Cancel
Save