Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1648 from Tyriar/webpack_demo
Improve demo build task
- Loading branch information
Showing
19 changed files
with
869 additions
and
320 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/** | ||
* Copyright (c) 2018 The xterm.js authors. All rights reserved. | ||
* @license MIT | ||
* | ||
* This file is the entry point for browserify. | ||
*/ | ||
|
||
const cp = require('child_process'); | ||
const path = require('path'); | ||
const webpack = require('webpack'); | ||
|
||
// Launch server | ||
cp.spawn('node', [path.resolve(__dirname, 'server.js')], { stdio: 'inherit' }); | ||
|
||
// Build/watch client source | ||
const clientConfig = { | ||
entry: path.resolve(__dirname, 'client.ts'), | ||
devtool: 'inline-source-map', | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.tsx?$/, | ||
use: 'ts-loader', | ||
exclude: /node_modules/ | ||
} | ||
] | ||
}, | ||
resolve: { | ||
extensions: [ '.tsx', '.ts', '.js' ] | ||
}, | ||
output: { | ||
filename: 'client-bundle.js', | ||
path: path.resolve(__dirname, 'dist') | ||
}, | ||
mode: 'development', | ||
watch: true | ||
}; | ||
const compiler = webpack(clientConfig); | ||
|
||
compiler.watch({ | ||
// Example watchOptions | ||
aggregateTimeout: 300, | ||
poll: undefined | ||
}, (err, stats) => { | ||
// Print watch/build result here... | ||
console.log(stats.toString({ | ||
colors: true | ||
})); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"compilerOptions": { | ||
"module": "commonjs", | ||
"target": "es5", | ||
"rootDir": ".", | ||
"sourceMap": true | ||
}, | ||
"include": [ | ||
"client.ts", | ||
"../typings/xterm.d.ts" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,10 @@ | |
"compilerOptions": { | ||
"module": "commonjs", | ||
"target": "es5", | ||
"lib": [ | ||
"dom", | ||
"es6" | ||
], | ||
"noEmit": true | ||
} | ||
} |
Oops, something went wrong.