Skip to content

Updating angular 6 and fixing webpack issues and rxjs issue. #2007

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config/spec-bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ require('zone.js/dist/fake-async-test');
/**
* RxJS
*/
require('rxjs/Rx');
// require('rxjs/Rx');

var testing = require('@angular/core/testing');
var browser = require('@angular/platform-browser-dynamic/testing');
Expand Down
2 changes: 1 addition & 1 deletion config/webpack.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ module.exports = function (options) {
*
* BE AWARE that not using lettable operators will probably result in significant payload added to your bundle.
*/
alias: buildUtils.rxjsAlias(supportES2015)
// alias: buildUtils.rxjsAlias(supportES2015)
},

/**
Expand Down
34 changes: 11 additions & 23 deletions config/webpack.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ const commonConfig = require('./webpack.common.js');
* Webpack Plugins
*/
const SourceMapDevToolPlugin = require('webpack/lib/SourceMapDevToolPlugin');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const HashedModuleIdsPlugin = require('webpack/lib/HashedModuleIdsPlugin')
const PurifyPlugin = require('@angular-devkit/build-optimizer').PurifyPlugin;
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');



function getUglifyOptions (supportES2015) {
function getUglifyOptions(supportES2015) {
const uglifyCompressOptions = {
pure_getters: true, /* buildOptimizer */
// PURE comments work best with 3 passes.
Expand Down Expand Up @@ -109,10 +109,7 @@ module.exports = function (env) {
*/
{
test: /\.css$/,
loader: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: 'css-loader'
}),
use: [MiniCssExtractPlugin.loader, 'css-loader'],
include: [helpers.root('src', 'styles')]
},

Expand All @@ -121,12 +118,9 @@ module.exports = function (env) {
*/
{
test: /\.scss$/,
loader: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: 'css-loader!sass-loader'
}),
use: [MiniCssExtractPlugin.loader, 'css-loader', 'sass-loader'],
include: [helpers.root('src', 'styles')]
},
}

]

Expand All @@ -147,13 +141,7 @@ module.exports = function (env) {
}),


/**
* Plugin: ExtractTextPlugin
* Description: Extracts imported CSS files into external stylesheet
*
* See: https://github.com/webpack/extract-text-webpack-plugin
*/
new ExtractTextPlugin('[name].[contenthash].css'),
new MiniCssExtractPlugin({ filename: '[name]-[hash].css', chunkFilename: '[name]-[chunkhash].css' }),

new PurifyPlugin(), /* buildOptimizer */

Expand All @@ -169,7 +157,7 @@ module.exports = function (env) {
* NOTE: To debug prod builds uncomment //debug lines and comment //prod lines
*/
new UglifyJsPlugin({
sourceMap: true,
sourceMap: false,
parallel: true,
uglifyOptions: getUglifyOptions(supportES2015)
}),
Expand All @@ -182,10 +170,10 @@ module.exports = function (env) {
* See: https://github.com/webpack/compression-webpack-plugin
*/
// install compression-webpack-plugin
/* new CompressionPlugin({
regExp: /\.css$|\.html$|\.js$|\.map$/,
threshold: 2 * 1024
})*/
/* new CompressionPlugin({
regExp: /\.css$|\.html$|\.js$|\.map$/,
threshold: 2 * 1024
})*/

],

Expand Down
1 change: 0 additions & 1 deletion config/webpack.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ module.exports = function (options) {
/**
* These packages have problems with their sourcemaps
*/
helpers.root('node_modules/rxjs'),
helpers.root('node_modules/@angular')
]
},
Expand Down
Loading