-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
Only vendor.css is being generated when mode is "production". #7791
Comments
I don't know if this is important but here is the Webpack execution log:
Main.less appears here:
Searching for
Looking at the json generated with --stats I found this:
It seems the css was extracted by |
I created this repository reproducing the error: |
Besides your problem, vendor.ts is not an entry point and is therefore not allowed under entry when using webpack 4. |
Tried adding:
While this generates the
|
Thanks @Legend, why vendor.ts is not an entry point? Where cam I read more about this? |
Can't find it, it's buried somewhere. wp4 create a dependency graph out of your entry-point(s). An entry point is a real entry to your application. And in your entry-point you import other modules/vendor modules which in turn again import some other modules, etc.... webpack then creates optimized bundles out of your entry points. |
Even with just one entry, the main.less is not generated unless I add it to sideEffects. =( |
I didn't say that it doesn't render main.less because of having In general I would do: package.json:
Otherwise it can happen that your css/less files are treeshaked in |
Thanks @Legends! Problem solved by adding less and css to sideEffects. |
Bug report
What is the current behavior?
Only vendor.css is being generated when mode is "production".
If the current behavior is a bug, please provide the steps to reproduce.
When I run Webpack in production mode, only vendor.css bundle is generated. Development mode generates both main.css and vendor.css.
Here is my Webpack configuration:
I also commented the lines below to find what plugin is causing this, but the problem persists.
I think the problem is this line:
What is the expected behavior?
Bundle main.css should also be generated.
Other relevant information:
webpack version: 4.16.2
Node.js version: v8.10.0
Operating System: Linux (Ubuntu)
Additional tools:
The text was updated successfully, but these errors were encountered: