refactor(config): migrate configuration files to ES module syntax

- Updated jest.config.js, postcss.config.js, and tailwind.config.js to use ES module export syntax.
- Added "type": "module" to package.json to support ES module imports.
- Refactored copy-tinymce.js to utilize ES module imports and defined __dirname for compatibility.
This commit is contained in:
chamiakJ
2025-06-03 10:49:24 +05:30
parent e59216af54
commit 593e6cfa98
5 changed files with 11 additions and 5 deletions

View File

@@ -1,4 +1,4 @@
module.exports = { export default {
setupFilesAfterEnv: ['<rootDir>/src/setupTests.ts'], setupFilesAfterEnv: ['<rootDir>/src/setupTests.ts'],
moduleNameMapper: { moduleNameMapper: {
'^@/(.*)$': '<rootDir>/src/$1', '^@/(.*)$': '<rootDir>/src/$1',

View File

@@ -2,6 +2,7 @@
"name": "worklenz", "name": "worklenz",
"version": "1.0.0", "version": "1.0.0",
"private": true, "private": true,
"type": "module",
"scripts": { "scripts": {
"start": "vite", "start": "vite",
"prebuild": "node scripts/copy-tinymce.js", "prebuild": "node scripts/copy-tinymce.js",

View File

@@ -1,4 +1,4 @@
module.exports = { export default {
plugins: { plugins: {
tailwindcss: {}, tailwindcss: {},
autoprefixer: {}, autoprefixer: {},

View File

@@ -1,5 +1,10 @@
const fs = require('fs'); import fs from 'fs';
const path = require('path'); import path from 'path';
import { fileURLToPath } from 'url';
// Get __dirname equivalent for ES modules
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
// Create the directory if it doesn't exist // Create the directory if it doesn't exist
const targetDir = path.join(__dirname, '..', 'public', 'tinymce'); const targetDir = path.join(__dirname, '..', 'public', 'tinymce');

View File

@@ -1,5 +1,5 @@
/** @type {import('tailwindcss').Config} */ /** @type {import('tailwindcss').Config} */
module.exports = { export default {
content: ['./src/**/*.{js,jsx,ts,tsx}'], content: ['./src/**/*.{js,jsx,ts,tsx}'],
theme: { theme: {
extend: {}, extend: {},