Skip to content
This repository was archived by the owner on Nov 12, 2025. It is now read-only.

Commit 888dc06

Browse files
authored
BREAKING CHANGE: updated to Angular 6, ngx-bootstrap 3, ngx-datatable 13, rxjs 6, gulp 4, and webpack 4 (#359)
Dropped the tree-list component due to Angular 6 issues with mobx autorun, introduced by angular-tree-component -- see #381 Removed 3.x deprecations in favor of individual module imports - NavigationItemConfig: Use VerticalNavigationItem or ApplicationLauncherItem - NavigationModule: Use ApplicationLauncherModule or VerticalNavigationModule - PipeModule: Use SearchHighlightModule, SortArrayModule, or TruncateModule - NotificationModule: Use InlineNotificationModule, NotificationDrawerModule, NotificationServiceModule, ToastNotificationModule, or ToastNotificationListModule - ListModule: Use TreeListModule and ListModule for basic list only - ChartConfig: Use ChartConfigBase, DonutChartConfig, or SparklineChartConfig - ChartModule: Use DonutChartModule and SparklineChartModule - DonutConfig: Use DonutChartConfig or UtilizationDonutChartConfig - SparklineComponent: Use SparklineChartComponent - SparklineConfig: Use SparklineChartConfig - SparklineData: Use SparklineChartData - CardModule: Use InfoStatusCardModule and CardModule for basic card only - ModalModule: Use AboutModal
1 parent d1613e0 commit 888dc06

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+22389
-1006
lines changed

.npmrc

Lines changed: 0 additions & 1 deletion
This file was deleted.

config/webpack.common.js

Lines changed: 67 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,14 @@ const path = require('path'),
99
/**
1010
* Webpack Plugins
1111
*/
12-
const ContextReplacementPlugin = require('webpack/lib/ContextReplacementPlugin');
13-
const DefinePlugin = require('webpack/lib/DefinePlugin');
14-
const ExtractTextPlugin = require('extract-text-webpack-plugin');
12+
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
1513
const HtmlWebpackPlugin = require('html-webpack-plugin');
16-
const IgnorePlugin = require('webpack/lib/IgnorePlugin');
17-
const LoaderOptionsPlugin = require('webpack/lib/LoaderOptionsPlugin');
18-
const NormalModuleReplacementPlugin = require('webpack/lib/NormalModuleReplacementPlugin');
1914
const OptimizeJsPlugin = require('optimize-js-plugin');
20-
const ProvidePlugin = require('webpack/lib/ProvidePlugin');
21-
const UglifyJsPlugin = require('webpack/lib/optimize/UglifyJsPlugin');
2215

23-
// ExtractTextPlugin
24-
const extractCSS = new ExtractTextPlugin({
25-
filename: '[name].[id].css',
26-
allChunks: true
16+
// MiniCssExtractPlugin
17+
const extractCSS = new MiniCssExtractPlugin({
18+
filename: '[name].css',
19+
chunkFilename: "[id].css"
2720
});
2821

2922
module.exports = {
@@ -41,57 +34,68 @@ module.exports = {
4134
module: {
4235
rules: [
4336
{
44-
enforce: 'pre',
4537
test: /\.ts$/,
38+
enforce: 'pre',
4639
use: 'tslint-loader',
4740
exclude: [helpers.root('node_modules')]
4841
},
4942
{
5043
test: /\.ts$/,
5144
use: [
52-
{
53-
loader: 'awesome-typescript-loader',
54-
options: {
55-
declaration: false
56-
}
57-
},
58-
{
59-
loader: 'angular2-template-loader'
60-
}
45+
// 'awesome-typescript-loader',
46+
'ts-loader',
47+
'angular2-template-loader'
6148
],
6249
exclude: [/\.spec\.ts$/]
63-
},{
64-
test: /\.css$/,
65-
loader: extractCSS.extract({
66-
fallback: "style-loader",
67-
use: "css-loader?sourceMap&context=/"
68-
})
6950
},
7051

71-
/* File loader for supporting fonts, for example, in CSS files.
52+
/*
53+
* to string and css loader support for *.css files
54+
* Returns file content as string
55+
*
7256
*/
7357
{
74-
test: /\.woff2?$|\.ttf$|\.eot$|\.svg$/,
75-
loaders: [
76-
{
77-
loader: "url-loader",
78-
query: {
79-
limit: 3000,
80-
name: 'assets/fonts/[name].[ext]'
58+
test: /\.css$/,
59+
use: [
60+
MiniCssExtractPlugin.loader, {
61+
loader: "css-loader",
62+
options: {
63+
minimize: true,
64+
sourceMap: true
8165
}
66+
}]
67+
},
68+
69+
/**
70+
* File loader for supporting fonts, for example, in CSS files.
71+
*/
72+
{
73+
test: /\.(woff2|woff|ttf|eot|svg)$/,
74+
use: {
75+
loader: 'url-loader',
76+
query: {
77+
limit: 3000,
78+
// includePaths: [
79+
// path.resolve(__dirname, "../node_modules/patternfly/dist/fonts/")
80+
// ],
81+
name: 'assets/fonts/[name].[ext]'
8282
}
83-
]
84-
}, {
85-
test: /\.jpg$|\.png$|\.gif$|\.jpeg$/,
86-
loaders: [
87-
{
88-
loader: "url-loader",
89-
query: {
90-
limit: 3000,
91-
name: 'assets/fonts/[name].[ext]'
92-
}
83+
},
84+
exclude: path.resolve(__dirname, "../src/demo/images/")
85+
},
86+
{
87+
test: /\.(jpg|png|svg|gif|jpeg)$/,
88+
use: {
89+
loader: 'url-loader',
90+
query: {
91+
limit: 3000,
92+
includePaths: [
93+
path.resolve(__dirname, "../src/assets/images/")
94+
],
95+
name: 'assets/images/[name].[ext]'
9396
}
94-
]
97+
},
98+
exclude: path.resolve(__dirname, "../node_modules/patternfly/dist/fonts/")
9599
},
96100

97101
// Support for *.json files.
@@ -107,8 +111,22 @@ module.exports = {
107111
}
108112
]
109113
},
110-
114+
/*
115+
optimization: {
116+
splitChunks: {
117+
cacheGroups: {
118+
commons: {
119+
test: /[\\/]node_modules[\\/]/,
120+
name: "styles",
121+
chunks: "all"
122+
}
123+
}
124+
}
125+
},
126+
*/
111127
plugins: [
128+
extractCSS,
129+
112130
/**
113131
* Plugin: ContextReplacementPlugin
114132
* Description: Provides context to Angular's use of System.import
@@ -141,7 +159,6 @@ module.exports = {
141159
*
142160
* See: https://github.com/webpack/extract-text-webpack-plugin
143161
*/
144-
// new ExtractTextPlugin('[name].[contenthash].css'),
145162
new ExtractTextPlugin('[name].css'),
146163

147164
new webpack.LoaderOptionsPlugin({
@@ -151,19 +168,6 @@ module.exports = {
151168
*
152169
* See: https://github.com/webpack/html-loader#advanced-options
153170
*/
154-
// TODO: Need to workaround Angular 2's html syntax => #id [bind] (event) *ngFor
155-
// htmlLoader: {
156-
// minimize: true,
157-
// removeAttributeQuotes: false,
158-
// caseSensitive: true,
159-
// customAttrSurround: [
160-
// [/#/, /(?:)/],
161-
// [/\*/, /(?:)/],
162-
// [/\[?\(?/, /(?:)/]
163-
// ],
164-
// customAttrAssign: [/\)?\]?=/]
165-
// },
166-
167171
tslintLoader: {
168172
emitErrors: false,
169173
failOnHint: false
@@ -174,27 +178,16 @@ module.exports = {
174178
// Only emit files when there are no errors
175179
new webpack.NoEmitOnErrorsPlugin(),
176180

177-
// // Reference: http://webpack.github.io/docs/list-of-plugins.html#dedupeplugin
178-
// // Dedupe modules in the output
179-
// new webpack.optimize.DedupePlugin(),
180-
181181
// Reference: http://webpack.github.io/docs/list-of-plugins.html#uglifyjsplugin
182182
// Minify all javascript, switch loaders to minimizing mode
183183
// new webpack.optimize.UglifyJsPlugin({sourceMap: true, mangle: { keep_fnames: true }}),
184184

185-
// Copy assets from the public folder
186-
// Reference: https://github.com/kevlened/copy-webpack-plugin
187-
// new CopyWebpackPlugin([{
188-
// from: helpers.root('src/public')
189-
// }]),
190-
191185
// Reference: https://github.com/johnagan/clean-webpack-plugin
192186
// Removes the bundle folder before the build
193187
new CleanWebpackPlugin(['bundles'], {
194188
root: helpers.root(),
195189
verbose: false,
196190
dry: false
197-
}),
198-
extractCSS
191+
})
199192
]
200193
};

0 commit comments

Comments
 (0)