Skip to content

Conversation

@gquinteros93
Copy link
Owner

@gquinteros93 gquinteros93 commented Mar 16, 2021

Summary

This PR includes the app working on Angular Version 11.

Description

The base of the solution was provided by Paul Buechner on this Pull Request.

After that PR, the missing configurations were:
1. Updates libraries versiones:

2. Updates postcss-loader plugins on extra-webpack.config.js

From:

    const scssRule = config.module.rules.find(x => x.test.toString().includes('scss'));
    const postcssLoader = scssRule.use.find(x => x.loader.toString().includes('postcss-loader'));
    const pluginFunc = postcssLoader.options.plugins;
    const newPluginFunc = function () {
        var plugs = pluginFunc.apply(this, arguments);
        plugs.splice(plugs.length - 1, 0, postcssModules({ generateScopedName: "[hash:base64:5]" }));
        return plugs;
    }
    postcssLoader.options.plugins = newPluginFunc;

To:

    const scssRule = config.module.rules.find(x => x.test.toString().includes('scss'));
    const postcssLoader = scssRule.use.find(x => x.loader.toString().includes('postcss-loader'));
    const pluginFunc = postcssLoader.options.postcssOptions;
    const newPluginFunc = function () {
        var plugs = pluginFunc.apply(this, arguments);
        plugs.plugins.splice(plugs.plugins.length - 1, 0, postcssModules({ generateScopedName: "[hash:base64:5]" }));
        return plugs;
    }
    postcssLoader.options.postcssOptions = newPluginFunc;

Contribution

Thanks Paul Buechner for the initiative to migrate this project to version 11 and for doing most of the work 👏 👏 👏

Issues

Copy link
Collaborator

@paulbuechner paulbuechner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is still a problem with the timing when scss.json files are generated and when they're loaded for the compilation process as @mjheller addressed in #7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

migration Libraries Migration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Postcss-loader fails to properly map/load hashed scss files Migration to angular version 11@latest

2 participants