Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Steve Dunlap authored and Steve Dunlap committed Nov 13, 2017
0 parents commit f65f867
Show file tree
Hide file tree
Showing 37 changed files with 12,011 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .editorconfig
@@ -0,0 +1,8 @@
root = true

[*]
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
1 change: 1 addition & 0 deletions .gitattributes
@@ -0,0 +1 @@
* text=auto
3 changes: 3 additions & 0 deletions .gitignore
@@ -0,0 +1,3 @@

dist/
node_modules/
3 changes: 3 additions & 0 deletions .vscode/settings.json
@@ -0,0 +1,3 @@
{
"typescript.tsdk": "node_modules\\typescript\\lib"
}
10 changes: 10 additions & 0 deletions config/helpers.js
@@ -0,0 +1,10 @@

const path = require('path');
const _root = path.resolve(__dirname, '..');

function root(args) {
args = Array.prototype.slice.call(arguments, 0);
return path.join.apply(path, [_root].concat(args));
}

exports.root = root;
93 changes: 93 additions & 0 deletions config/webpack.common.js
@@ -0,0 +1,93 @@

const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const helpers = require('./helpers');
//const DashboardPlugin = require('webpack-dashboard/plugin');



module.exports = {

entry: {
'polyfills': './src/polyfills.ts',
'vendor': './src/vendor.ts',
'app': './src/main.ts'
},

resolve: {
extensions: ['.ts', '.js']
},

module: {
rules: [
{
test: /\.ts$/,
loaders: [
{
loader: 'ng-router-loader',
options: {
/* ng-router-loader options */
}
},
{
loader: 'awesome-typescript-loader',
options: { configFileName: helpers.root('', 'tsconfig.json') }
},
'angular2-template-loader'
]
},
{
test: /\.json/,
use: 'json-loader'
},
{
test: /\.html$/,
use: 'html-loader'
},
{
test: /\.(png|jpe?g|gif|svg|woff|woff2|ttf|eot|ico)$/,
use: 'file-loader?name=assets/[name].[hash].[ext]'
},
{
test: /\.css$/,
exclude: helpers.root('src', 'app'),
use: ExtractTextPlugin.extract({ fallback: 'style-loader', use: 'css-loader?sourceMap' })
},
{
test: /\.css$/,
include: helpers.root('src', 'app'),
use: 'raw-loader'
},
{
test: /\.scss$/,
exclude: /node_modules/,
loaders: ['raw-loader', 'sass-loader']
}
]
},

plugins: [

// Workaround for angular/angular#11580
new webpack.ContextReplacementPlugin(
// The (\\|\/) piece accounts for path separators in *nix and Windows
/angular(\\|\/)core(\\|\/)(esm(\\|\/)src|src)(\\|\/)linker/,
helpers.root('./src'), // location of your src
{} // a map of your routes
),

new webpack.optimize.CommonsChunkPlugin({
name: ['app', 'vendor', 'polyfills']
}),

new HtmlWebpackPlugin({
template: 'src/index.html',
title: 'Output Management'
})

//new DashboardPlugin({
// port: 3000
//})
]
};
25 changes: 25 additions & 0 deletions config/webpack.dev.js
@@ -0,0 +1,25 @@

const webpackMerge = require('webpack-merge');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const commonConfig = require('./webpack.common.js');
const helpers = require('./helpers');



module.exports = webpackMerge(commonConfig, {

devtool: 'cheap-module-eval-source-map',

output: {
path: helpers.root('dist'),
publicPath: 'http://localhost:3000/',
filename: '[name].js',
chunkFilename: '[id].chunk.js'
},

devServer: {
historyApiFallback: true,
compress: true,
stats: 'minimal'
}
});

0 comments on commit f65f867

Please sign in to comment.