Skip to content

Commit

Permalink
chore: change transpiler
Browse files Browse the repository at this point in the history
- remove babel config and references to babel in package.json
- add esbuild
  • Loading branch information
oze4 committed Jul 31, 2021
1 parent 6e052ed commit 2d11d94
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 30 deletions.
5 changes: 4 additions & 1 deletion __tests__/demo/demo-components/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import React, { useState, useRef } from 'react';

// root of this project
import MaterialTable, { MTableBodyRow, MTableEditRow } from '../../../src';
import MaterialTable, {
MTableBodyRow,
MTableEditRow
} from '../../../dist_esbuild';

export { default as EditableRowDateColumnIssue } from './EditableRowDateColumnIssue';

Expand Down
8 changes: 0 additions & 8 deletions babel.config.js

This file was deleted.

27 changes: 11 additions & 16 deletions esbuild.config.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,3 @@
/**
* THIS FILE IS NOT IN USE RIGHT NOW
* We had issues using esbuild - I just need to revisit
* (I think the root of the issue wasn't even esbuild so we
* may just need to publish a test pkg using it)
* - oze4 -
*/

const { build } = require('esbuild');
const { red, green, yellow, italic } = require('chalk');
const rimraf = require('rimraf');
Expand All @@ -21,7 +7,14 @@ const fs = require('fs');
const { log } = console;
const { stdout, stderr, exit } = process;

const BUILD_DIR = 'dist'; // relative to root of project (no trailing slash)
/**
* OUTPUT PATH IS SET HERE!!
*
* relative to root of project
*
* !! NO TRAILING SLASH !!
*/
const BUILD_DIR = 'dist';

stdout.write(yellow(`-Cleaning build artifacts from : '${BUILD_DIR}' `));

Expand All @@ -35,10 +28,12 @@ rimraf(path.resolve(__dirname, BUILD_DIR), async (error) => {

const options = {
entryPoints: getFilesRecursive('./src', '.js'),
minifySyntax: true,
minify: true,
bundle: false,
outdir: `${BUILD_DIR}`,
format: 'cjs',
target: 'es6',
// format: 'cjs',
loader: {
'.js': 'jsx'
}
Expand Down
7 changes: 2 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,16 @@
"version": "3.2.5",
"description": "Datatable for React based on https://material-ui.com/api/table/ with additional features",
"main": "dist/index.js",
"type": "module",
"types": "types/index.d.ts",
"files": [
"dist",
"types"
],
"babel": {
"extends": "./babel.config.js"
},
"scripts": {
"start": "./node_modules/.bin/webpack serve --config ./__tests__/demo/webpack.config.js --mode development --progress",
"build:esbuild": "node esbuild.config.js",
"build": "npm run build:root",
"build:root": "./node_modules/.bin/babel src -d dist",
"build": "npm run build:esbuild",
"lint": "npm run eslint && npm run tsc",
"eslint": "./node_modules/.bin/eslint src/** -c ./.eslintrc --ignore-path ./.eslintignore",
"tsc": "./node_modules/.bin/tsc --noEmit --lib es6,dom --skipLibCheck types/index.d.ts",
Expand Down

0 comments on commit 2d11d94

Please sign in to comment.