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
.nyc_output
npm-debug.log

View file

@ -8,7 +8,7 @@ import 'jquery'
// Always land on the start view
location.hash = ''
import { RootModule } from 'app.module'
import { RootModule } from './app.module'
import { enableProdMode } from '@angular/core'
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": {
"build": "webpack --progress --color",
"watch": "webpack --progress --color --watch",
"pack": "build --dir",
"postinstall": "install-app-deps",
"dist": "build"

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,69 +1,8 @@
const path = require("path")
const webpack = require("webpack")
module.exports = {
target: 'node',
entry: {
'index.ignore': 'file-loader?name=index.html!pug-html-loader!./app/index.pug',
'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",
}),
]
}
module.exports = [
require('./app/webpack.config.js'),
require('./terminus-core/webpack.config.js'),
require('./terminus-settings/webpack.config.js'),
require('./terminus-terminal/webpack.config.js'),
require('./terminus-clickable-links/webpack.config.js'),
require('./terminus-community-color-schemes/webpack.config.js'),
]