1
1
mirror of https://github.com/Eugeny/tabby.git synced 2024-12-22 10:01:40 +03:00
This commit is contained in:
Eugene Pankov 2017-04-12 12:12:57 +02:00
parent c3edd1cd72
commit 137c100bbf
14 changed files with 164 additions and 104 deletions

1
.gitignore vendored
View File

@ -21,3 +21,4 @@ driver/obj
coverage coverage
.nyc_output .nyc_output
npm-debug.log

View File

@ -8,7 +8,7 @@ import 'jquery'
// Always land on the start view // Always land on the start view
location.hash = '' location.hash = ''
import { RootModule } from 'app.module' import { RootModule } from './app.module'
import { enableProdMode } from '@angular/core' import { enableProdMode } from '@angular/core'
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic' import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'

71
app/webpack.config.js Normal file
View File

@ -0,0 +1,71 @@
const path = require('path')
const webpack = require('webpack')
module.exports = {
name: 'terminus',
target: 'node',
entry: {
'index.ignore': 'file-loader?name=index.html!pug-html-loader!' + path.resolve(__dirname, './index.pug'),
'preload': path.resolve(__dirname, 'src/entry.preload.ts'),
'bundle': path.resolve(__dirname, 'src/entry.ts'),
},
context: __dirname,
devtool: 'source-map',
output: {
path: path.join(__dirname, 'assets', 'webpack'),
pathinfo: true,
//publicPath: 'assets/webpack/',
filename: '[name].js'
},
resolve: {
modules: ['src/', 'node_modules', '../node_modules', 'assets/'].map(x => path.join(__dirname, x)),
extensions: ['.ts', '.js'],
},
module: {
loaders: [
{
test: /\.ts$/,
use: 'awesome-typescript-loader',
exclude: [/node_modules/]
},
{
test: /\.scss$/,
use: ['style-loader', 'css-loader', 'sass-loader'],
},
{
test: /\.css$/,
use: ['style-loader', 'css-loader', 'sass-loader'],
},
{
test: /\.(png|svg)$/,
loader: "file-loader",
options: {
name: 'images/[name].[hash:8].[ext]'
}
},
{
test: /\.(ttf|eot|otf|woff|woff2)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
loader: "file-loader",
options: {
name: 'fonts/[name].[hash:8].[ext]'
}
}
]
},
externals: {
'@angular/core': 'commonjs @angular/core',
'@angular/compiler': 'commonjs @angular/compiler',
'@angular/platform-browser': 'commonjs @angular/platform-browser',
'@angular/platform-browser-dynamic': 'commonjs @angular/platform-browser-dynamic',
'@angular/forms': 'commonjs @angular/forms',
'@angular/common': 'commonjs @angular/common',
'@ng-bootstrap/ng-bootstrap': 'commonjs @ng-bootstrap/ng-bootstrap',
'rxjs': 'commonjs rxjs',
'zone.js': 'commonjs zone.js',
},
plugins: [
new webpack.ProvidePlugin({
"window.jQuery": "jquery",
}),
]
}

View File

@ -58,6 +58,8 @@
} }
}, },
"scripts": { "scripts": {
"build": "webpack --progress --color",
"watch": "webpack --progress --color --watch",
"pack": "build --dir", "pack": "build --dir",
"postinstall": "install-app-deps", "postinstall": "install-app-deps",
"dist": "build" "dist": "build"

View File

@ -1,15 +1,19 @@
const path = require('path')
module.exports = { module.exports = {
target: 'node', target: 'node',
entry: 'src/index.ts', entry: 'src/index.ts',
devtool: 'source-map', devtool: 'source-map',
context: __dirname,
output: { output: {
filename: './dist/index.js', path: path.resolve(__dirname, 'dist'),
filename: 'index.js',
pathinfo: true, pathinfo: true,
libraryTarget: 'umd', libraryTarget: 'umd',
devtoolModuleFilenameTemplate: 'webpack-terminus-clickable-links:///[resource-path]', devtoolModuleFilenameTemplate: 'webpack-terminus-clickable-links:///[resource-path]',
}, },
resolve: { resolve: {
modules: ['.', 'node_modules', '../app/node_modules'], modules: ['.', 'src', 'node_modules', '../app/node_modules'].map(x => path.join(__dirname, x)),
extensions: ['.ts', '.js'], extensions: ['.ts', '.js'],
}, },
module: { module: {
@ -17,6 +21,12 @@ module.exports = {
{ {
test: /\.ts$/, test: /\.ts$/,
loader: 'awesome-typescript-loader', loader: 'awesome-typescript-loader',
query: {
paths: {
"terminus-*": [path.resolve(__dirname, '../terminus-*')],
"*": [path.resolve(__dirname, '../app/node_modules/*')],
}
}
}, },
] ]
}, },

View File

@ -1,20 +1,33 @@
const path = require('path')
module.exports = { module.exports = {
target: 'node', target: 'node',
entry: 'src/index.ts', entry: 'src/index.ts',
devtool: 'source-map', devtool: 'source-map',
context: __dirname,
output: { output: {
filename: './dist/index.js', path: path.resolve(__dirname, 'dist'),
filename: 'index.js',
pathinfo: true, pathinfo: true,
libraryTarget: 'umd', libraryTarget: 'umd',
devtoolModuleFilenameTemplate: 'webpack-terminus-community-color-schemes:///[resource-path]', devtoolModuleFilenameTemplate: 'webpack-terminus-community-color-schemes:///[resource-path]',
}, },
resolve: { resolve: {
modules: ['.', 'node_modules', '../app/node_modules'], modules: ['.', 'src', 'node_modules', '../app/node_modules'].map(x => path.join(__dirname, x)),
extensions: ['.ts', '.js'], extensions: ['.ts', '.js'],
}, },
module: { module: {
loaders: [ loaders: [
{ test: /\.ts$/, loader: 'awesome-typescript-loader' }, {
test: /\.ts$/,
loader: 'awesome-typescript-loader',
options: {
paths: {
"terminus-*": [path.resolve(__dirname, '../terminus-*')],
"*": [path.resolve(__dirname, '../app/node_modules/*')],
}
}
},
{ test: /\/schemes\//, loader: "raw-loader" }, { test: /\/schemes\//, loader: "raw-loader" },
] ]
}, },

View File

@ -20,11 +20,7 @@
"dom", "dom",
"es2015", "es2015",
"es7" "es7"
], ]
"paths": {
"*": ["../../app/node_modules/*"],
"terminus-*": ["../../terminus-*"]
}
}, },
"include": [ "include": [
"src" "src"

View File

@ -1,20 +1,33 @@
const path = require('path')
module.exports = { module.exports = {
target: 'node', target: 'node',
entry: 'src/index.ts', entry: 'src/index.ts',
devtool: 'source-map', devtool: 'source-map',
context: __dirname,
output: { output: {
filename: './dist/index.js', path: path.resolve(__dirname, 'dist'),
filename: 'index.js',
pathinfo: true, pathinfo: true,
libraryTarget: 'umd', libraryTarget: 'umd',
devtoolModuleFilenameTemplate: 'webpack-terminus-core:///[resource-path]', devtoolModuleFilenameTemplate: 'webpack-terminus-core:///[resource-path]',
}, },
resolve: { resolve: {
modules: ['.', 'src', 'node_modules', '../app/node_modules'], modules: ['.', 'src', 'node_modules', '../app/node_modules'].map(x => path.join(__dirname, x)),
extensions: ['.ts', '.js'], extensions: ['.ts', '.js'],
}, },
module: { module: {
loaders: [ loaders: [
{ test: /\.ts$/, use: 'awesome-typescript-loader' }, {
test: /\.ts$/,
loader: 'awesome-typescript-loader',
options: {
paths: {
"terminus-*": [path.resolve(__dirname, '../terminus-*')],
"*": [path.resolve(__dirname, '../app/node_modules/*')],
}
}
},
{ test: /\.pug$/, use: ['apply-loader', 'pug-loader'] }, { test: /\.pug$/, use: ['apply-loader', 'pug-loader'] },
{ test: /\.scss$/, use: ['style-loader', 'css-loader', 'sass-loader'], exclude: /components\// }, { test: /\.scss$/, use: ['style-loader', 'css-loader', 'sass-loader'], exclude: /components\// },
{ test: /\.scss$/, use: ['to-string-loader', 'css-loader', 'sass-loader'], include: /components\// }, { test: /\.scss$/, use: ['to-string-loader', 'css-loader', 'sass-loader'], include: /components\// },

View File

@ -20,11 +20,7 @@
"dom", "dom",
"es2015", "es2015",
"es7" "es7"
], ]
"paths": {
"*": ["../../app/node_modules/*"],
"terminus-*": ["../../terminus-*"]
}
}, },
"include": [ "include": [
"src" "src"

View File

@ -1,20 +1,33 @@
const path = require('path')
module.exports = { module.exports = {
target: 'node', target: 'node',
entry: 'src/index.ts', entry: 'src/index.ts',
devtool: 'source-map', devtool: 'source-map',
context: __dirname,
output: { output: {
filename: './dist/index.js', path: path.resolve(__dirname, 'dist'),
filename: 'index.js',
pathinfo: true, pathinfo: true,
libraryTarget: 'commonjs', libraryTarget: 'umd',
devtoolModuleFilenameTemplate: 'webpack-terminus-settings:///[resource-path]', devtoolModuleFilenameTemplate: 'webpack-terminus-settings:///[resource-path]',
}, },
resolve: { resolve: {
modules: ['.', 'node_modules', '../app/node_modules'], modules: ['.', 'src', 'node_modules', '../app/node_modules'].map(x => path.join(__dirname, x)),
extensions: ['.ts', '.js'], extensions: ['.ts', '.js'],
}, },
module: { module: {
loaders: [ loaders: [
{ test: /\.ts$/, use: 'awesome-typescript-loader', exclude: [/node_modules/] }, {
test: /\.ts$/,
loader: 'awesome-typescript-loader',
options: {
paths: {
"terminus-*": [path.resolve(__dirname, '../terminus-*')],
"*": [path.resolve(__dirname, '../app/node_modules/*')],
}
}
},
{ test: /schemes\/.*$/, use: "raw-loader" }, { test: /schemes\/.*$/, use: "raw-loader" },
{ test: /\.pug$/, use: ['apply-loader', 'pug-loader'] }, { test: /\.pug$/, use: ['apply-loader', 'pug-loader'] },
{ test: /\.scss$/, use: ['to-string-loader', 'css-loader', 'sass-loader'] }, { test: /\.scss$/, use: ['to-string-loader', 'css-loader', 'sass-loader'] },

View File

@ -20,11 +20,7 @@
"dom", "dom",
"es2015", "es2015",
"es7" "es7"
], ]
"paths": {
"*": ["../../app/node_modules/*"],
"terminus-*": ["../../terminus-*"]
}
}, },
"compileOnSave": false, "compileOnSave": false,
"exclude": [ "exclude": [

View File

@ -1,20 +1,33 @@
const path = require('path')
module.exports = { module.exports = {
target: 'node', target: 'node',
entry: 'src/index.ts', entry: 'src/index.ts',
devtool: 'source-map', devtool: 'source-map',
context: __dirname,
output: { output: {
filename: './dist/index.js', path: path.resolve(__dirname, 'dist'),
filename: 'index.js',
pathinfo: true, pathinfo: true,
libraryTarget: 'umd', libraryTarget: 'umd',
devtoolModuleFilenameTemplate: 'webpack-terminus-terminal:///[resource-path]', devtoolModuleFilenameTemplate: 'webpack-terminus-terminal:///[resource-path]',
}, },
resolve: { resolve: {
modules: ['.', 'node_modules', '../app/node_modules'], modules: ['.', 'src', 'node_modules', '../app/node_modules'].map(x => path.join(__dirname, x)),
extensions: ['.ts', '.js'], extensions: ['.ts', '.js'],
}, },
module: { module: {
loaders: [ loaders: [
{ test: /\.ts$/, use: 'awesome-typescript-loader' }, {
test: /\.ts$/,
loader: 'awesome-typescript-loader',
query: {
paths: {
"terminus-*": [path.resolve(__dirname, '../terminus-*')],
"*": [path.resolve(__dirname, '../app/node_modules/*')],
}
}
},
{ test: /schemes\/.*$/, use: "raw-loader" }, { test: /schemes\/.*$/, use: "raw-loader" },
{ test: /\.pug$/, use: ['apply-loader', 'pug-loader'] }, { test: /\.pug$/, use: ['apply-loader', 'pug-loader'] },
{ test: /\.scss$/, use: ['to-string-loader', 'css-loader', 'sass-loader'] }, { test: /\.scss$/, use: ['to-string-loader', 'css-loader', 'sass-loader'] },

View File

@ -19,10 +19,7 @@
"es2015", "es2015",
"es2015.iterable.ts", "es2015.iterable.ts",
"es7" "es7"
], ]
"paths": {
"terminus-*": ["../../terminus-*"]
}
}, },
"compileOnSave": false, "compileOnSave": false,
"exclude": [ "exclude": [

View File

@ -1,69 +1,8 @@
const path = require("path") module.exports = [
const webpack = require("webpack") require('./app/webpack.config.js'),
require('./terminus-core/webpack.config.js'),
module.exports = { require('./terminus-settings/webpack.config.js'),
target: 'node', require('./terminus-terminal/webpack.config.js'),
entry: { require('./terminus-clickable-links/webpack.config.js'),
'index.ignore': 'file-loader?name=index.html!pug-html-loader!./app/index.pug', require('./terminus-community-color-schemes/webpack.config.js'),
'preload': './app/src/entry.preload.ts', ]
'bundle': './app/src/entry.ts',
},
devtool: 'source-map',
output: {
path: path.join(__dirname, 'app', 'assets', 'webpack'),
pathinfo: true,
//publicPath: 'assets/webpack/',
filename: '[name].js'
},
resolve: {
modules: ['app/src/', 'node_modules', 'app/assets/'],
extensions: ['.ts', '.js'],
},
module: {
loaders: [
{
test: /\.ts$/,
use: 'awesome-typescript-loader',
exclude: [/node_modules/]
},
{
test: /\.scss$/,
use: ['style-loader', 'css-loader', 'sass-loader'],
},
{
test: /\.css$/,
use: ['style-loader', 'css-loader', 'sass-loader'],
},
{
test: /\.(png|svg)$/,
loader: "file-loader",
options: {
name: 'images/[name].[hash:8].[ext]'
}
},
{
test: /\.(ttf|eot|otf|woff|woff2)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
loader: "file-loader",
options: {
name: 'fonts/[name].[hash:8].[ext]'
}
}
]
},
externals: {
'@angular/core': 'commonjs @angular/core',
'@angular/compiler': 'commonjs @angular/compiler',
'@angular/platform-browser': 'commonjs @angular/platform-browser',
'@angular/platform-browser-dynamic': 'commonjs @angular/platform-browser-dynamic',
'@angular/forms': 'commonjs @angular/forms',
'@angular/common': 'commonjs @angular/common',
'@ng-bootstrap/ng-bootstrap': 'commonjs @ng-bootstrap/ng-bootstrap',
'rxjs': 'commonjs rxjs',
'zone.js': 'commonjs zone.js',
},
plugins: [
new webpack.ProvidePlugin({
"window.jQuery": "jquery",
}),
]
}