Skip to content

Commit

Permalink
Merge pull request #2219 from Tyriar/addon_webpack
Browse files Browse the repository at this point in the history
Webpack addons
  • Loading branch information
Tyriar authored Jun 10, 2019
2 parents c4311cb + 3e91f08 commit 68db066
Show file tree
Hide file tree
Showing 13 changed files with 161 additions and 21 deletions.
9 changes: 6 additions & 3 deletions addons/xterm-addon-attach/package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
{
"name": "xterm-addon-attach",
"version": "0.1.0-beta10",
"version": "0.1.0-beta11",
"author": {
"name": "The xterm.js authors",
"url": "https://xtermjs.org/"
},
"main": "lib/AttachAddon.js",
"main": "lib/xterm-addon-attach.js",
"types": "typings/xterm-addon-attach.d.ts",
"license": "MIT",
"scripts": {
"prepublishOnly": "../../node_modules/.bin/tsc -p src"
"build": "../../node_modules/.bin/tsc -p src",
"prepackage": "npm run build",
"package": "../../node_modules/.bin/webpack",
"prepublishOnly": "npm run package"
},
"peerDependencies": {
"xterm": "^3.14.0"
Expand Down
2 changes: 1 addition & 1 deletion addons/xterm-addon-attach/src/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"es2015"
],
"rootDir": ".",
"outDir": "../lib",
"outDir": "../out",
"sourceMap": true,
"removeComments": true,
"strict": true
Expand Down
31 changes: 31 additions & 0 deletions addons/xterm-addon-attach/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/**
* Copyright (c) 2019 The xterm.js authors. All rights reserved.
* @license MIT
*/

const path = require('path');

const addonName = 'AttachAddon';
const mainFile = 'xterm-addon-attach.js';

module.exports = {
entry: `./out/${addonName}.js`,
devtool: 'source-map',
module: {
rules: [
{
test: /\.js$/,
use: ["source-map-loader"],
enforce: "pre",
exclude: /node_modules/
}
]
},
output: {
filename: mainFile,
path: path.resolve('./lib'),
library: addonName,
libraryTarget: 'umd'
},
mode: 'production'
};
9 changes: 6 additions & 3 deletions addons/xterm-addon-fit/package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
{
"name": "xterm-addon-fit",
"version": "0.1.0-beta2",
"version": "0.1.0-beta3",
"author": {
"name": "The xterm.js authors",
"url": "https://xtermjs.org/"
},
"main": "lib/FitAddon.js",
"main": "lib/xterm-addon-fit.js",
"types": "typings/xterm-addon-fit.d.ts",
"license": "MIT",
"scripts": {
"prepublishOnly": "../../node_modules/.bin/tsc -p src"
"build": "../../node_modules/.bin/tsc -p src",
"prepackage": "npm run build",
"package": "../../node_modules/.bin/webpack",
"prepublishOnly": "npm run package"
},
"peerDependencies": {
"xterm": "^3.14.0"
Expand Down
2 changes: 1 addition & 1 deletion addons/xterm-addon-fit/src/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"es2015"
],
"rootDir": ".",
"outDir": "../lib",
"outDir": "../out",
"sourceMap": true,
"removeComments": true,
"strict": true
Expand Down
31 changes: 31 additions & 0 deletions addons/xterm-addon-fit/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/**
* Copyright (c) 2019 The xterm.js authors. All rights reserved.
* @license MIT
*/

const path = require('path');

const addonName = 'FitAddon';
const mainFile = 'xterm-addon-fit.js';

module.exports = {
entry: `./out/${addonName}.js`,
devtool: 'source-map',
module: {
rules: [
{
test: /\.js$/,
use: ["source-map-loader"],
enforce: "pre",
exclude: /node_modules/
}
]
},
output: {
filename: mainFile,
path: path.resolve('./lib'),
library: addonName,
libraryTarget: 'umd'
},
mode: 'production'
};
9 changes: 6 additions & 3 deletions addons/xterm-addon-search/package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
{
"name": "xterm-addon-search",
"version": "0.1.0-beta5",
"version": "0.1.0-beta6",
"author": {
"name": "The xterm.js authors",
"url": "https://xtermjs.org/"
},
"main": "lib/SearchAddon.js",
"main": "lib/xterm-addon-search.js",
"types": "typings/xterm-addon-search.d.ts",
"license": "MIT",
"scripts": {
"prepublishOnly": "../../node_modules/.bin/tsc -p src"
"build": "../../node_modules/.bin/tsc -p src",
"prepackage": "npm run build",
"package": "../../node_modules/.bin/webpack",
"prepublishOnly": "npm run package"
},
"peerDependencies": {
"xterm": "^3.14.0"
Expand Down
2 changes: 1 addition & 1 deletion addons/xterm-addon-search/src/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"es6",
],
"rootDir": ".",
"outDir": "../lib",
"outDir": "../out",
"sourceMap": true,
"removeComments": true,
"strict": true
Expand Down
31 changes: 31 additions & 0 deletions addons/xterm-addon-search/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/**
* Copyright (c) 2019 The xterm.js authors. All rights reserved.
* @license MIT
*/

const path = require('path');

const addonName = 'SearchAddon';
const mainFile = 'xterm-addon-search.js';

module.exports = {
entry: `./out/${addonName}.js`,
devtool: 'source-map',
module: {
rules: [
{
test: /\.js$/,
use: ["source-map-loader"],
enforce: "pre",
exclude: /node_modules/
}
]
},
output: {
filename: mainFile,
path: path.resolve('./lib'),
library: addonName,
libraryTarget: 'umd'
},
mode: 'production'
};
9 changes: 6 additions & 3 deletions addons/xterm-addon-web-links/package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
{
"name": "xterm-addon-web-links",
"version": "0.1.0-beta9",
"version": "0.1.0-beta10",
"author": {
"name": "The xterm.js authors",
"url": "https://xtermjs.org/"
},
"main": "lib/WebLinksAddon.js",
"main": "lib/xterm-addon-web-links.js",
"types": "typings/xterm-addon-web-links.d.ts",
"license": "MIT",
"scripts": {
"prepublishOnly": "../../node_modules/.bin/tsc -p src"
"build": "../../node_modules/.bin/tsc -p src",
"prepackage": "npm run build",
"package": "../../node_modules/.bin/webpack",
"prepublishOnly": "npm run package"
},
"peerDependencies": {
"xterm": "^3.14.0"
Expand Down
2 changes: 1 addition & 1 deletion addons/xterm-addon-web-links/src/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"es2015"
],
"rootDir": ".",
"outDir": "../lib",
"outDir": "../out",
"sourceMap": true,
"removeComments": true,
"strict": true
Expand Down
31 changes: 31 additions & 0 deletions addons/xterm-addon-web-links/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/**
* Copyright (c) 2019 The xterm.js authors. All rights reserved.
* @license MIT
*/

const path = require('path');

const addonName = 'WebLinksAddon';
const mainFile = 'xterm-addon-web-links.js';

module.exports = {
entry: `./out/${addonName}.js`,
devtool: 'source-map',
module: {
rules: [
{
test: /\.js$/,
use: ["source-map-loader"],
enforce: "pre",
exclude: /node_modules/
}
]
},
output: {
filename: mainFile,
path: path.resolve('./lib'),
library: addonName,
libraryTarget: 'umd'
},
mode: 'production'
};
14 changes: 9 additions & 5 deletions demo/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,17 @@

// Use tsc version (yarn watch)
import { Terminal } from '../out/public/Terminal';
import { AttachAddon } from '../addons/xterm-addon-attach/out/AttachAddon';
import { FitAddon } from '../addons/xterm-addon-fit/out/FitAddon';
import { SearchAddon, ISearchOptions } from '../addons/xterm-addon-search/out/SearchAddon';
import { WebLinksAddon } from '../addons/xterm-addon-web-links/out/WebLinksAddon';

// Use webpacked version (yarn package)
// import { Terminal } from '../lib/xterm';

import { AttachAddon } from 'xterm-addon-attach';
import { FitAddon } from 'xterm-addon-fit';
import { SearchAddon, ISearchOptions } from 'xterm-addon-search';
import { WebLinksAddon } from 'xterm-addon-web-links';
// import { AttachAddon } from 'xterm-addon-attach';
// import { FitAddon } from 'xterm-addon-fit';
// import { SearchAddon, ISearchOptions } from 'xterm-addon-search';
// import { WebLinksAddon } from 'xterm-addon-web-links';

// Pulling in the module's types relies on the <reference> above, it's looks a
// little weird here as we're importing "this" module
Expand Down

0 comments on commit 68db066

Please sign in to comment.