AhamedBilal / ngx-photo-editor

Angular Photo Editor
https://ahamedbilal.github.io/ngx-photo-editor/
MIT License
25 stars 26 forks source link

Angular 17 has issue in css [photo-editor.css] #38

Open abidtkg opened 11 months ago

abidtkg commented 11 months ago

File Name: ngx-photo-editor/photo-editor.css In line 1 casing issue @import "~cropperjs/dist/cropper.css"; It's working now as @import "../cropperjs/dist/cropper.css"; in Angular 17

Please anyone review that and fix it.

maxbauer commented 8 months ago

I'm using a quick & dirty prebuild script which replaces the import in my Angular 17 project

const fs = require('fs');
const path = require('path');

// Define the path to the file you want to modify
const filePath = path.join(__dirname, 'node_modules/ngx-photo-editor/photo-editor.css');

// Read the content of the file
fs.readFile(filePath, 'utf8', (err, data) => {
  if (err) {
    return console.log(err);
  }

  // Replace the import statement
  const result = data.replace('@import "~cropperjs/dist/cropper.css";', '@import "../cropperjs/dist/cropper.css";');

  // Write the file back
  fs.writeFile(filePath, result, 'utf8', (err) => {
     if (err) return console.log(err);
  });
});