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

Change Vite config from CJS to ESM #1992

Merged
merged 8 commits into from
Nov 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@
"check-license": "./scripts/check-license.sh",
"coverage": "yarn workspaces run coverage",
"depcheck": "./scripts/run-depcheck.sh",
"eslint": "eslint --cache 'scripts/*.{js,jsx,ts,tsx}' 'packages/*/src/**/*.{js,jsx,ts,tsx}' 'packages/*/*.{js,jsx,ts,tsx}'",
"eslint": "eslint --cache 'scripts/*.{js,jsx,ts,tsx}' 'packages/*/src/**/*.{js,jsx,ts,tsx}' 'packages/*/*.{js,jsx,ts,tsx,mts}'",
"fmt": "yarn prettier",
"lint": "npm-run-all -ln --parallel prettier-lint tsc-lint eslint check-license",
"prepare": "yarn workspace @jaegertracing/plexus prepublishOnly",
"prettier": "prettier --write '{.,scripts}/*.{js,jsx,json,md,ts,tsx}' 'packages/*/{src,demo/src}/**/!(layout.worker.bundled|react-vis).{css,js,jsx,json,md,ts,tsx}' 'packages/*/*.{css,js,jsx,json,md,ts,tsx}'",
"prettier-lint": "prettier --list-different '{.,scripts}/*.{js,jsx,json,md,ts,tsx}' 'packages/*/{src,demo/src}/**/!(layout.worker.bundled|react-vis).{css,js,jsx,json,md,ts,tsx}' 'packages/*/*.{css,js,jsx,json,md,ts,tsx}' || (echo '*** PLEASE RUN yarn prettier AND RESUBMIT ***' && false)",
"prettier": "prettier --write '{.,scripts}/*.{js,jsx,json,md,ts,tsx,mts}' 'packages/*/{src,demo/src}/**/!(layout.worker.bundled|react-vis).{css,js,jsx,json,md,ts,tsx}' 'packages/*/*.{css,js,jsx,json,md,ts,tsx,mts}'",
"prettier-lint": "prettier --list-different '{.,scripts}/*.{js,jsx,json,md,ts,tsx,mts}' 'packages/*/{src,demo/src}/**/!(layout.worker.bundled|react-vis).{css,js,jsx,json,md,ts,tsx}' 'packages/*/*.{css,js,jsx,json,md,ts,tsx,mts}' || (echo '*** PLEASE RUN yarn prettier AND RESUBMIT ***' && false)",
"test": "yarn workspaces run test",
"tsc-lint": "tsc --build",
"tsc-lint-debug": "tsc --listFiles",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
// limitations under the License.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • are the *.mts files included in our linter?
  • instead of renaming the file, why not add "type": "module" to ./packages/jaeger-ui/package.json?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are the *.mts files included in our linter?

no they arent.. forgot to check that.

yeah you are right that would be better. making the change...


/* eslint-disable import/no-extraneous-dependencies */
import { defineConfig } from 'vite';
import { PluginOption, defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import legacy from '@vitejs/plugin-legacy';
import vitePluginImp from 'vite-plugin-imp';
import visualizer from 'rollup-plugin-visualizer';
import { visualizer } from 'rollup-plugin-visualizer';

const proxyConfig = {
target: 'http://localhost:16686',
Expand Down Expand Up @@ -57,7 +57,7 @@ export default defineConfig({
exclude: ['lodash'],
}),
// Generate a bundle size breakdown.
visualizer(),
visualizer() as PluginOption,
],
css: {
preprocessorOptions: {
Expand Down
1 change: 0 additions & 1 deletion packages/plexus/webpack-factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

/* eslint-disable import/no-extraneous-dependencies */
/* eslint-disable @typescript-eslint/no-var-requires */

const { join } = require('path');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
Expand Down