myliang / x-spreadsheet

The project has been migrated to @wolf-table/table https://github.com/wolf-table/table
https://myliang.github.io/x-spreadsheet
MIT License
14.14k stars 1.7k forks source link

Unable to build against webpack terser plugin #176

Open Betalos opened 5 years ago

Betalos commented 5 years ago

Hi, well after trying to build the project, terser plugin would trow this error: Unexpected token: punc ()) [./node_modules/x-data-spreadsheet/src/core/cell_range.js:93,0

myliang commented 5 years ago

what's your development environment

Betalos commented 5 years ago

@myliang, well i am in angular-cli@8.2.0 project but the issue comes up in prod building phase with the optimisation of webpac's terser plugin.

Betalos commented 5 years ago

@myliang, I think the error here is there "," that should be removed in "./src/core/cell_range.js" line 92 :

  union(other) {
    const {
      sri, sci, eri, eci,
    } = this;
    return new CellRange(
      other.sri < sri ? other.sri : sri,
      other.sci < sci ? other.sci : sci,
      other.eri > eri ? other.eri : eri,
      other.eci > eci ? other.eci : eci, // <-- need to be removed
    );
  }
myliang commented 5 years ago

add file .eslintignore to project

node_modules
rabi-iwa commented 4 years ago

Hello @myliang

I am also having the same issue with Angular build. Adding the .eslintignore file to the project and adding node_modules inside it did not help.

Is there any way to get rid of those extra comma(,)?

rabi-iwa commented 4 years ago

@Betalos how did you tackle this issue?

deepthan commented 4 years ago

@rabi-iwa hi, set optimization to false in angular.json can be solved.

harshith-venkatesh commented 3 years ago

@deepthan , Thanks for the update, it worked Although I believe resolving the above issue would definitely help a lot of people facing similar situation which is addressed by @Betalos