Skip to content
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

Both BundleStyles and keepStyles must be set #145

Closed
maciejkoch opened this issue Nov 7, 2019 · 4 comments
Closed

Both BundleStyles and keepStyles must be set #145

maciejkoch opened this issue Nov 7, 2019 · 4 comments
Labels
bug Something isn't working

Comments

@maciejkoch
Copy link

Is the condition for bundleStyles and keepStyles correct? Both by default are set as true so you have to set both as false to avoid deleting entry styles.

https://github.com/manfredsteyer/ngx-build-plus/blob/cli8/lib/src/utils/index.ts

if (options.singleBundle && (options.bundleStyles !== false || options.keepStyles) && config.entry && config.entry['styles']) {
  delete config.entry['styles'];
}
@manfredsteyer
Copy link
Owner

Good point.

@manfredsteyer manfredsteyer added the bug Something isn't working label Nov 7, 2019
kessenich pushed a commit to kessenich/ngx-build-plus that referenced this issue Nov 18, 2019
@kessenich
Copy link

Can we remove the deprecated bundleStyles?
Else I don't have an idea to fix the issue. Maybe make it better, that it works with the default values !(options.bundleStyles || options.keepStyles). But than for deleting the styles both options must be false (so the opposite we have).

I have seen, that the schema.json's have all default properties from Angular. With the new angular_devkit and Angular 8 Builders, we can combine the schemas in the createBuilder Method. Would maybe nice for maintenance.

@hisham
Copy link

hisham commented Feb 25, 2020

I tried setting both variables to false but I am getting the following in angular/cli 9.0.3:

Further investigation shows 'filename' is a function and so does not have endsWith method.

ng build --prod --output-hashing none --single-bundle --bundle-styles=false --keep-styles=false  

ERROR in chunk styles [entry]
({
              chunk: chunkData
            }) => this.options.moduleFilename(chunkData)
filename.endsWith is not a function
TypeError: filename.endsWith is not a function
    at <redact>/node_modules/@angular-devkit/build-angular/src/angular-cli-files/models/webpack-configs/common.js:108:72
    at SyncWaterfallHook.eval [as call] (eval at create (<redact>/frontend/node_modules/tapable/lib/HookCodeFactory.js:19:10), <anonymous>:5:16)
    at MainTemplate.getAssetPathWithInfo (<redact>/frontend/node_modules/webpack/lib/MainTemplate.js:527:40)
    at Compilation.getPathWithInfo (/Users/hisham/src/ess-app/frontend/node_modules/webpack/lib/Compilation.js:2227:28)
    at Compilation.createChunkAssets (<redact>/node_modules/webpack/lib/Compilation.js:2138:31)
 ...

@hisham
Copy link

hisham commented Feb 26, 2020

I filed angular/angular-cli#17087 for the fileName.endsWith issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants