mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
Fix webpack headless
This commit is contained in:
@@ -2,6 +2,7 @@ node_modules/
|
||||
*.swp
|
||||
.lock-wscript
|
||||
lib/
|
||||
lib-headless/
|
||||
out/
|
||||
out-test/
|
||||
.nyc_output/
|
||||
|
||||
+2
-2
@@ -2,8 +2,8 @@ Cursory test that 'xterm-core' works:
|
||||
|
||||
```
|
||||
# From root of this repo
|
||||
npm run compile # Outputs to xterm-core
|
||||
npx webpack --config webpack.config.core.js # Outputs to lib
|
||||
npm run compile # Outputs to out/headless
|
||||
npx webpack --config webpack.config.headless.js # Outputs to lib
|
||||
cd node-test
|
||||
npm link ../lib/
|
||||
node index.js
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
"es2015",
|
||||
"es2016.Array.Include"
|
||||
],
|
||||
"outDir": "../../out/headless", // Temporary outdir to avoid collisions with 'xterm'
|
||||
"outDir": "../../out",
|
||||
"types": [
|
||||
"../../node_modules/@types/mocha",
|
||||
"../../node_modules/@types/node"
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
/**
|
||||
* Copyright (c) 2019 The xterm.js authors. All rights reserved.
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
const path = require('path');
|
||||
|
||||
/**
|
||||
* This webpack config does a production build for xterm.js. It works by taking the output from tsc
|
||||
* (via `yarn watch` or `yarn prebuild`) which are put into `out/` and webpacks them into a
|
||||
* production mode umd library module in `lib/`. The aliases are used fix up the absolute paths
|
||||
* output by tsc (because of `baseUrl` and `paths` in `tsconfig.json`.
|
||||
*/
|
||||
module.exports = {
|
||||
entry: './out/headless/public/Terminal.js',
|
||||
devtool: 'source-map',
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.js$/,
|
||||
use: ["source-map-loader"],
|
||||
enforce: "pre",
|
||||
exclude: /node_modules/
|
||||
}
|
||||
]
|
||||
},
|
||||
resolve: {
|
||||
modules: ['./node_modules'],
|
||||
extensions: [ '.js' ],
|
||||
alias: {
|
||||
common: path.resolve('./out/common'),
|
||||
headless: path.resolve('./out/headless')
|
||||
}
|
||||
},
|
||||
output: {
|
||||
filename: 'xterm.js',
|
||||
path: path.resolve('./lib-headless'),
|
||||
libraryTarget: 'umd'
|
||||
},
|
||||
mode: 'production'
|
||||
};
|
||||
Reference in New Issue
Block a user