-
-
Notifications
You must be signed in to change notification settings - Fork 198
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
Angular 11 support #908
Comments
Hi, thanks for your interest. I assume you're asking about |
hey @just-jeb I upgraded to
Also do I need to update custom-webpack to version 11 in order to use Also, I do not use any merge strategies expliclty defined.. Here is a snippet of my custom config
and this is my config in
|
An update. |
Hey @jeetparikh,
Yes, you need the versions to be aligned. If you use
Makes very much sense, the breaking change of |
hey @just-jeb yep that makes sense. But the fact that I don't use any specific merge strategy or rules.. Just the default version.. |
@jeetparikh Well, default rules are the ones that I defined in order to make it as similar as possible to the |
@jeetparikh The issue happens because the original config uses |
hey @just-jeb here is the repo with minimal reproduction of the same use Tried to use |
Right, that's still happening. "mergeRules": {
"module": {
"rules": {
"test": "match",
"use": "append"
}
}
} I wonder whether I should put this as a default, since this is the most common case. This would mean that only if anyone would want to change options of an existing loader they would have to pass explicit rules. |
Correction, you have to use the following rules: "mergeRules": {
"module": {
"rules": "append"
}
} This is because you have an |
I'm getting this on beta.3, any ideas? It looks like to be an issue with Tailwind Config:
|
@renatoaraujoc what are your merge rules and what is the expected outcome? Do you want to override the post-css plugins? Append? Could you create a reproduction please? |
hey @just-jeb thanks for the inputs. Does this mean it would still merge my config for my custom rules with the rules provided by angular cli? or append would mean my rules take precedence? Also does the order of rules then matter? Thanks |
hey @just-jeb getting the same error as @renatoaraujoc with
but am not sure of the outcome. Thanks |
@just-jeb I'm just using the common tailwind css custom web pack config that you can find on the internet (that's the entire file). Where do I put those mergeRules thing? Renato |
Painfully I have noticed by experience that Every angular update and they are frequent that the build config format changes....had to update the regret...tested 11.0.0-beta.4 got the same errors like @renatoaraujoc , apparently i missed the memo "mergeRules" whats that a new twist...here my old webpack.config and postcss.config could you please show us the new way of typing in whats suppose to be a simple Config file that would work thank you //webpack.config
const path = require('path');
let sassReader;
try {
sassReader= require('node-sass');
} catch {
sassReader= require('sass');
}
module.exports = {
// Fix for: https://github.com/recharts/recharts/issues/1463
node: {
},
module: {
rules: [
{
test: /\.scss$/i,
use: [
'postcss-loader',
{
loader: 'sass-loader',
options: {
implementation: sassReader,
sourceMap: false,
sassOptions: {
precision: 8
}
}
}
]
},
{
test: /styles[\\\/]tailwind\.scss$/,
use: [
{
loader: '@fullhuman/purgecss-loader',
options: {
content: [
path.join(__dirname, 'src/**/*.html'),
path.join(__dirname, 'src/**/*.ts')
],
defaultExtractor: content => content.match(/[\w-/:]+(?<!:)/g) || []
}
},
'postcss-loader',
{
loader: 'sass-loader',
options: {
implementation: sassImplementation,
sourceMap: false,
sassOptions: {
precision: 8
}
}
}
]
}
]
}
};
// postcss.config
module.exports = {
parser: 'postcss-scss',
plugins: [
require('tailwindcss')
]
} |
Guys, there is a migration guide I update with each major version. @renatoaraujoc Another place where you can find "where you put those merge rules thing" is the docs of the builder you're using. I'm doing my best in order to help you all, but as you can imagine I also have a life and a work and it's physically impossible to debug each one of your configs. I just don't have enough time for this. |
All: @jeetparikh You still merge your rules, you just define a way it's merged. "mergeRules": {
"module": {
"rules": "append"
}
} means that the rules from your config are appended to the rules from the original config.
So if your rule is appended to the rules of the original config, then your rule will actually be executed first for the matching files. |
Thanks @just-jeb, that merge rules script works for me. I'm testing the loader now if everything works fine. |
Thanks @just-jeb and sorry did not see the migration guide . We wish you only the best in life, health and in your work which as you can see we cant function without. |
@axmad22 Huh, thanks for the kind words. Btw, everyone, one of the simplest things you could do when you stumble across an issue is doing a bit of a debug:
Object.defineProperty(RegExp.prototype, "toJSON", {
value: RegExp.prototype.toString
}); This is exactly what I'm doing with your repro projects, and if you did it in advance and came with the data ready it would help a great deal. |
@renatoaraujoc There is a bug in merge, for some reason one of the loaders gets screwed in the resulting config:
I'm looking into it, I suspect it's a problem with webpack-merge. |
Hi @just-jeb , Is @renatoaraujoc issue related to using loaders? I build the solution without error using the custom config with loaders. Unfortunately, it seems loaders is not executed because there are no changes in the HTML file with SVG when I used markup-inline-loader. |
@mbdmardy Yes, it's related to loaders, but I'm still not certain about what happens there yet. If you're not getting the error he does then probably it's not the same problem. |
Indeed an issue with TBH I'm starting to question my decision to upgrade to the new version of |
@just-jeb, I'm trying to transform the img HTML element with markup inline to SVG using loader. I don't have an issue with this config in the build below and I already confirm that this config is merged in mergeConfigs (webpack-config-merger.js). It seems this the loader is not executed /triggered. Config: module.exports = { This is the goal |
Thanks @just-jeb , I'm gonna try those fix. |
Got to start learning webpack....,but after some reading finally figured I had to add the mergeRules to the angular.json customWebpackConfig section and not in the webpack.config.js >< "customWebpackConfig": {
"path": "./webpack.config.js",
"mergeRules": {
"module": {
"rules": "append"
}
}
}, It now builds but with some css errors tailwind related but everything is functioning now, also am not sure if it relevant but the option webpack_merge_1.CustomizeRule.Merge, in webpack-merge is undefined. Thanks @just-jeb |
FYI if you use TypeScript 4.1 (using the Angular 11.1 pre-releases), then you get this error message:
Tried the same versions of everything with TS4.0 (while commenting out the lines of my app that rely on TS4.1 bugfixes) and everything compiles correctly. Also with the regular Angular builders (non custom-webpack) and TS4.1, the app builds correctly, so I think the custom-webpack builder needs to be updated to support TS4.1. EDIT: Here's an example that causes that error: https://github.com/elliotleelewis/portfolio/pull/155/files |
hey @just-jeb totally understand where you are coming from. You have been totally awesome and super helpful via slack channels and resolving issues. Highly appreciate your efforts. Everyone including myself needs to be more careful and helpful to all OSS contributors as you guys do it in your free time and don't get paid for it. Thanks once again :)
Hey @just-jeb thank you for confirming.. with
|
I'm just awaiting a resolution guys, I'd help fix stuff myself but I hardly know how to webpack... I'm currently using beta.1 so I can build my app without any issues. |
@elliotleelewis thanks for bringing it up. I believe the problem is with version mismatch. See, the builder uses the @renatoaraujoc as I mentioned the issue is with |
Hi @just-jeb it works the fix for the loaders awesome!. Everything works fine on my end for the beta 4 version. pls, leave a comment once you release the stable version. your awesome dude! you're the man! |
@renatoaraujoc I issued a PR that fixes the problem in |
@renatoaraujoc @axmad22 Please try version |
v11 is officially released. |
@just-jeb it's working 100%! Thank you! |
Hi Guys,
I would like to know your plan or timeline to release the stable version for Angular 11 support? your feedback and update much appreciated. This package really cool so we're planning to utilize it good work!.
Thank you
The text was updated successfully, but these errors were encountered: