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

minifying chart.js #6659

Closed
tschmit opened this issue Oct 31, 2019 · 1 comment
Closed

minifying chart.js #6659

tschmit opened this issue Oct 31, 2019 · 1 comment

Comments

@tschmit
Copy link

tschmit commented Oct 31, 2019

Expected Behavior

minify without error

Current Behavior

when minifying chart.js the minifyer argues that:

2>D:\dev\fromGit\myProject\myProject\wwwroot\lib\chartjs\dist\Chart.min.js(362,27,362,27): Bundler & Minifier error 0: Strict-mode does not allow assignment to undefined variables: b
2>D:\dev\fromGit\myProject\myProject\wwwroot\lib\chartjs\dist\Chart.min.js(362,20,362,20): Bundler & Minifier error 0: Strict-mode does not allow assignment to undefined variables: g
2>D:\dev\fromGit\myProject\myProject\wwwroot\lib\chartjs\dist\Chart.min.js(362,13,362,13): Bundler & Minifier error 0: Strict-mode does not allow assignment to undefined variables: r
2>D:\dev\fromGit\myProject\myProject\wwwroot\lib\chartjs\dist\Chart.min.js(363,27,363,27): Bundler & Minifier error 0: Strict-mode does not allow assignment to undefined variables: b
2>D:\dev\fromGit\myProject\myProject\wwwroot\lib\chartjs\dist\Chart.min.js(363,20,363,20): Bundler & Minifier error 0: Strict-mode does not allow assignment to undefined variables: g
2>D:\dev\fromGit\myProject\myProject\wwwroot\lib\chartjs\dist\Chart.min.js(363,13,363,13): Bundler & Minifier error 0: Strict-mode does not allow assignment to undefined variables: r
2>D:\dev\fromGit\myProject\myProject\wwwroot\lib\chartjs\dist\Chart.min.js(364,28,364,28): Bundler & Minifier error 0: Strict-mode does not allow assignment to undefined variables: b
2>D:\dev\fromGit\myProject\myProject\wwwroot\lib\chartjs\dist\Chart.min.js(364,21,364,21): Bundler & Minifier error 0: Strict-mode does not allow assignment to undefined variables: g
2>D:\dev\fromGit\myProject\myProject\wwwroot\lib\chartjs\dist\Chart.min.js(364,13,364,13): Bundler & Minifier error 0: Strict-mode does not allow assignment to undefined variables: r
2>D:\dev\fromGit\myProject\myProject\wwwroot\lib\chartjs\dist\Chart.min.js(365,28,365,28): Bundler & Minifier error 0: Strict-mode does not allow assignment to undefined variables: b
2>D:\dev\fromGit\myProject\myProject\wwwroot\lib\chartjs\dist\Chart.min.js(365,21,365,21): Bundler & Minifier error 0: Strict-mode does not allow assignment to undefined variables: g
2>D:\dev\fromGit\myProject\myProject\wwwroot\lib\chartjs\dist\Chart.min.js(365,13,365,13): Bundler & Minifier error 0: Strict-mode does not allow assignment to undefined variables: r
2>D:\dev\fromGit\myProject\myProject\wwwroot\lib\chartjs\dist\Chart.min.js(366,28,366,28): Bundler & Minifier error 0: Strict-mode does not allow assignment to undefined variables: b
2>D:\dev\fromGit\myProject\myProject\wwwroot\lib\chartjs\dist\Chart.min.js(366,20,366,20): Bundler & Minifier error 0: Strict-mode does not allow assignment to undefined variables: g
2>D:\dev\fromGit\myProject\myProject\wwwroot\lib\chartjs\dist\Chart.min.js(366,13,366,13): Bundler & Minifier error 0: Strict-mode does not allow assignment to undefined variables: r
2>D:\dev\fromGit\myProject\myProject\wwwroot\lib\chartjs\dist\Chart.min.js(367,28,367,28): Bundler & Minifier error 0: Strict-mode does not allow assignment to undefined variables: b
2>D:\dev\fromGit\myProject\myProject\wwwroot\lib\chartjs\dist\Chart.min.js(367,20,367,20): Bundler & Minifier error 0: Strict-mode does not allow assignment to undefined variables: g
2>D:\dev\fromGit\myProject\myProject\wwwroot\lib\chartjs\dist\Chart.min.js(367,13,367,13): Bundler & Minifier error 0: Strict-mode does not allow assignment to undefined variables: r

Possible Solution

define the variables:

var r, g, b;
switch (i) {
    default:
    case 6:
    case 0: r = v; g = n; b = wh; break;
    case 1: r = n; g = v; b = wh; break;
    case 2: r = wh; g = v; b = n; break;
    case 3: r = wh; g = n; b = v; break;
    case 4: r = n; g = wh; b = v; break;
    case 5: r = v; g = wh; b = n; break;
  }

Steps to Reproduce (for bugs)

minify chart.js with "bundler and minifyer" under visual studio 2019 Community edition.

Environment

  • Chart.js version: 2.9.1
  • Browser name and version: NA
@tschmit tschmit changed the title minifying minifying chart.js Oct 31, 2019
@benmccann
Copy link
Contributor

Fix here: #6663

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

No branches or pull requests

2 participants