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

Bundle output include comments #40

Closed
DanielNetzer opened this issue Dec 2, 2018 · 2 comments
Closed

Bundle output include comments #40

DanielNetzer opened this issue Dec 2, 2018 · 2 comments

Comments

@DanielNetzer
Copy link

webpack.extra.js

const uglifyJSPlugin = require('uglifyjs-webpack-plugin');

module.exports = {
  "externals": {
    "rxjs": "rxjs",
    "@angular/core": "ng.core",
    "@angular/common": "ng.common",
    "@angular/platform-browser": "ng.platformBrowser",
    "@angular/elements": "ng.elements"
  },
  "output": {
    library: "omegaChatBot"
  },
  plugins: [
    new uglifyJSPlugin({
      uglifyOptions: {
        output: {
          comments: false
        }
      }
    })
  ]
}

Trying to add uglifyJSPlugin to the webpack extra result in a failure with the following error.

ERROR in scripts.js from UglifyJs
Unexpected token: keyword (const) [scripts.js:29,2]
@manfredsteyer
Copy link
Owner

That should not be necessary. Did you call ng build with --prod-?
In which file do you see the comments?

@DanielNetzer
Copy link
Author

main.js include the comments, and I did used ng build with --prod.
I copied the scripts from the sample application on this repo.
I eventually managed to add the uglifyJSPlugin to the build so the comments got removed.
all of the comments are @license comments of google

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants