Create a prod webpack config

This commit is contained in:
Daniel Imms
2019-05-26 11:23:31 -07:00
parent 873f0de0ec
commit 9ddf83ef26
2 changed files with 28 additions and 2 deletions
+3 -2
View File
@@ -52,7 +52,8 @@
"zmodem.js": "^0.1.5"
},
"scripts": {
"lib2": "webpack",
"package": "webpack",
"package-prod": "webpack --config webpack.prod.js",
"start": "node demo/start",
"start-debug": "node --inspect-brk demo/start",
"start-zmodem": "node demo/zmodem/app",
@@ -67,7 +68,7 @@
"prebuild": "tsc -b ./src/tsconfig.all.json",
"build": "gulp build",
"prepare": "npm run prebuild",
"prepublishOnly": "npm run build",
"prepublishOnly": "npm run package-prod",
"coveralls": "nyc report --reporter=text-lcov | coveralls",
"watch": "tsc -b -w ./src/tsconfig.all.json --preserveWatchOutput"
}
+25
View File
@@ -0,0 +1,25 @@
/**
* Copyright (c) 2019 The xterm.js authors. All rights reserved.
* @license MIT
*/
const path = require('path');
module.exports = {
entry: './out/public/Terminal.js',
resolve: {
modules: ['./node_modules'],
extensions: [ '.js' ],
alias: {
common: path.resolve('./out/common'),
core: path.resolve('./out/core')
}
},
output: {
filename: 'xterm.js',
path: path.resolve('./lib'),
library: 'Terminal',
libraryTarget: 'umd'
},
mode: 'production'
};