-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bundling loging upgraded to use Webpack; bugfix: CommonModule replaced with BrowserModule closes #1
- Loading branch information
1 parent
292faaa
commit d5b9746
Showing
30 changed files
with
769 additions
and
678 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,25 @@ | ||
# OS generated files | ||
Thumbs.db | ||
.DS_Store | ||
|
||
# npm and yarn | ||
# Node generated files | ||
node_modules | ||
*.log | ||
|
||
# build | ||
# Code coverage | ||
coverage | ||
|
||
# Ignored files | ||
bundles | ||
lib | ||
src/*.d.ts | ||
src/*.js | ||
index.d.ts | ||
index.js | ||
*.map | ||
|
||
# @angular/compiler-cli | ||
*.metadata.* | ||
*.ngsummary.* | ||
*.ngfactory.* | ||
*.ngstyle.* |
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 |
---|---|---|
@@ -1,14 +1,20 @@ | ||
# common | ||
node_modules | ||
demo | ||
*.log | ||
# OS generated files | ||
Thumbs.db | ||
.DS_Store | ||
.tmp | ||
|
||
# Webpack | ||
webpack.config.js | ||
# Node generated files | ||
node_modules | ||
*.log | ||
*.yml | ||
|
||
# source/config | ||
# Ignored files | ||
src | ||
*.yml | ||
config | ||
coverage | ||
demo | ||
.nyc_output | ||
.test | ||
.tmp | ||
.gitignore | ||
*.ts | ||
!*.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
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,29 @@ | ||
/** | ||
* angular2-expandable-list | ||
* | ||
* Copyright 2017, @andreasonny83, All rights reserved. | ||
* | ||
* @author: @andreasonny83 <[email protected]> | ||
*/ | ||
|
||
var path = require('path'); | ||
|
||
// Helper functions | ||
var ROOT = path.resolve(__dirname, '..'); | ||
|
||
function hasProcessFlag(flag) { | ||
return process.argv.join('').indexOf(flag) > -1; | ||
} | ||
|
||
function isWebpackDevServer() { | ||
return process.argv[1] && !! (/webpack-dev-server/.exec(process.argv[1])); | ||
} | ||
|
||
function root(args) { | ||
args = Array.prototype.slice.call(arguments, 0); | ||
return path.join.apply(path, [ROOT].concat(args)); | ||
} | ||
|
||
exports.hasProcessFlag = hasProcessFlag; | ||
exports.isWebpackDevServer = isWebpackDevServer; | ||
exports.root = root; |
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 |
---|---|---|
@@ -1,33 +1,34 @@ | ||
/** | ||
* angular2-expandable-list | ||
* | ||
* Copyright 2017, @andreasonny83, All rights reserved. | ||
* | ||
* @author: @andreasonny83 <[email protected]> | ||
*/ | ||
|
||
const path = require('path'); | ||
const helpers = require('./helpers'); | ||
const ContextReplacementPlugin = require('webpack/lib/ContextReplacementPlugin'); | ||
const TsConfigPathsPlugin = require('awesome-typescript-loader').TsConfigPathsPlugin; | ||
|
||
const ROOT = path.resolve(__dirname); | ||
|
||
function root(args) { | ||
args = Array.prototype.slice.call(arguments, 0); | ||
return path.join.apply(path, [ROOT].concat(args)); | ||
} | ||
|
||
module.exports = { | ||
devtool: 'cheap-module-source-map', | ||
|
||
entry: { | ||
'main': './demo/app.ts' | ||
'main': helpers.root('demo/app.ts') | ||
}, | ||
|
||
output: { | ||
path: root('demo'), | ||
path: helpers.root('demo'), | ||
filename: 'bundle.js', | ||
sourceMapFilename: '[name].map' | ||
}, | ||
|
||
resolve: { | ||
extensions: ['.ts', '.js'], | ||
modules: [ | ||
root('demo'), | ||
root('src'), | ||
root('node_modules'), | ||
helpers.root('node_modules'), | ||
], | ||
}, | ||
|
||
|
@@ -40,7 +41,7 @@ module.exports = { | |
loader: 'awesome-typescript-loader', | ||
options: { | ||
configFileName: 'demo/tsconfig.json' | ||
}, | ||
} | ||
}, | ||
{ | ||
loader: 'angular2-template-loader' | ||
|
@@ -50,7 +51,7 @@ module.exports = { | |
}, | ||
|
||
{ | ||
test: /\.css|html?$/, | ||
test: /\.(css|html)?$/, | ||
use: [ | ||
{ | ||
loader: 'raw-loader' | ||
|
@@ -61,11 +62,9 @@ module.exports = { | |
}, | ||
|
||
plugins: [ | ||
new TsConfigPathsPlugin(), | ||
|
||
new ContextReplacementPlugin( | ||
/angular(\\|\/)core(\\|\/)src(\\|\/)linker/, | ||
root('demo') | ||
helpers.root('demo') | ||
), | ||
] | ||
} |
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,96 @@ | ||
/** | ||
* angular2-expandable-list | ||
* | ||
* Copyright 2017, @andreasonny83, All rights reserved. | ||
* | ||
* @author: @andreasonny83 <[email protected]> | ||
*/ | ||
|
||
const helpers = require('./helpers'); | ||
const webpack = require('webpack'); | ||
|
||
/** | ||
* Webpack Plugins | ||
*/ | ||
const ProvidePlugin = require('webpack/lib/ProvidePlugin'); | ||
const DefinePlugin = require('webpack/lib/DefinePlugin'); | ||
const LoaderOptionsPlugin = require('webpack/lib/LoaderOptionsPlugin'); | ||
const ContextReplacementPlugin = require('webpack/lib/ContextReplacementPlugin'); | ||
|
||
function ngExternal(ns) { | ||
const ng2Ns = `@angular/${ns}`; | ||
return { root: ['ng', ns], commonjs: ng2Ns, commonjs2: ng2Ns, amd: ng2Ns }; | ||
} | ||
|
||
module.exports = { | ||
devtool: 'source-map', | ||
|
||
resolve: { | ||
extensions: ['.ts', '.js'] | ||
}, | ||
|
||
entry: helpers.root('./index.ts'), | ||
|
||
output: { | ||
path: helpers.root('bundles'), | ||
publicPath: '/', | ||
filename: 'angular2-expandable-list.umd.js', | ||
libraryTarget: 'umd', | ||
library: 'angular2-expandable-list' | ||
}, | ||
|
||
// require those dependencies but don't bundle them | ||
externals: { | ||
'@angular/core': ngExternal('core'), | ||
'@angular/common': ngExternal('common'), | ||
'@angular/platform-browser': ngExternal('platform-browser'), | ||
}, | ||
|
||
module: { | ||
rules: [ | ||
|
||
{ | ||
test: /\.ts$/, | ||
use: [ | ||
{ | ||
loader: 'awesome-typescript-loader', | ||
options: { | ||
declaration: false | ||
} | ||
}, | ||
{ | ||
loader: 'angular2-template-loader' | ||
} | ||
], | ||
exclude: [/\.e2e\.ts$/] | ||
}, | ||
|
||
{ | ||
test: /\.(css|html)?$/, | ||
use: [ | ||
{ | ||
loader: 'raw-loader' | ||
}, | ||
] | ||
}, | ||
|
||
] | ||
}, | ||
|
||
plugins: [ | ||
// fix the warning in ./~/@angular/core/src/linker/system_js_ng_module_factory_loader.js | ||
new ContextReplacementPlugin( | ||
/angular(\\|\/)core(\\|\/)(esm(\\|\/)src|src)(\\|\/)linker/, | ||
helpers.root('src') | ||
), | ||
|
||
new LoaderOptionsPlugin({ | ||
options: { | ||
tslintLoader: { | ||
emitErrors: false, | ||
failOnHint: false | ||
} | ||
} | ||
}) | ||
] | ||
}; |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 @@ | ||
export * from './lib/expandable-list.module'; |
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 |
---|---|---|
@@ -1,15 +1,18 @@ | ||
import { AfterContentInit } from '@angular/core'; | ||
import { AfterViewInit } from '@angular/core'; | ||
export declare class ExpandableListComponent { | ||
} | ||
export declare class ExpandableListStyler { | ||
} | ||
export declare class ExpandableListDividerStyler { | ||
} | ||
export declare class ExpandableListItemComponent implements AfterContentInit { | ||
export declare class ExpandableListItemComponent implements AfterViewInit { | ||
isExpanded: boolean; | ||
marginTop: string; | ||
disabled: boolean; | ||
isDisabled: boolean; | ||
private elHeight; | ||
private elementView; | ||
private isDisabled; | ||
constructor(); | ||
ngAfterContentInit(): void; | ||
ngAfterViewInit(): void; | ||
onClick(): void; | ||
} |
Oops, something went wrong.