Skip to content

Commit ed88f7b

Browse files
committed
chore(use-long-press): Remove @nrwl/vite and fix vite.config.ts
1 parent ae96d2d commit ed88f7b

File tree

4 files changed

+17
-381
lines changed

4 files changed

+17
-381
lines changed

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
"@chromatic-com/storybook": "^3",
2929
"@commitlint/cli": "^17.4.4",
3030
"@commitlint/config-conventional": "^17.4.4",
31-
"@nrwl/vite": "19.8.14",
3231
"@nx/eslint": "20.5.0-beta.4",
3332
"@nx/eslint-plugin": "20.5.0-beta.4",
3433
"@nx/jest": "20.5.0-beta.4",

packages/use-long-press/project.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"outputs": ["{options.outputFile}"]
1111
},
1212
"build": {
13-
"executor": "@nrwl/vite:build",
13+
"executor": "@nx/vite:build",
1414
"outputs": ["{options.outputPath}"],
1515
"defaultConfiguration": "production",
1616
"options": {
@@ -26,7 +26,7 @@
2626
}
2727
},
2828
"test": {
29-
"executor": "@nrwl/vite:test",
29+
"executor": "@nx/vite:test",
3030
"outputs": ["{workspaceRoot}/coverage/packages/use-long-press"],
3131
"options": {
3232
"passWithNoTests": true,

packages/use-long-press/vite.config.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,23 @@
11
/// <reference types="vitest" />
22
import { defineConfig } from 'vite';
33
import react from '@vitejs/plugin-react';
4-
import viteTsConfigPaths from 'vite-tsconfig-paths';
54
import dts from 'vite-plugin-dts';
6-
import { join } from 'path';
75
import { viteStaticCopy } from 'vite-plugin-static-copy';
6+
import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin';
7+
import { joinPathFragments } from 'nx/src/utils/path';
88

99
export default defineConfig({
10+
root: __dirname,
1011
cacheDir: '../../node_modules/.vite/use-long-press',
1112

1213
plugins: [
1314
dts({
1415
entryRoot: 'src',
15-
tsConfigFilePath: join(__dirname, 'tsconfig.lib.json'),
16+
tsConfigFilePath: joinPathFragments(__dirname, 'tsconfig.lib.json'),
1617
skipDiagnostics: true,
1718
}),
1819
react(),
19-
viteTsConfigPaths({
20-
root: '../../',
21-
}),
20+
nxViteTsPaths(),
2221
viteStaticCopy({
2322
targets: [
2423
{
@@ -42,6 +41,9 @@ export default defineConfig({
4241
// See: https://vitejs.dev/guide/build.html#library-mode
4342
build: {
4443
emptyOutDir: true,
44+
outDir: '../../dist/packages/use-long-press',
45+
reportCompressedSize: true,
46+
commonjsOptions: { transformMixedEsModules: true },
4547
lib: {
4648
// Could also be a dictionary or array of multiple entry points.
4749
entry: 'src/index.ts',
@@ -58,6 +60,7 @@ export default defineConfig({
5860
},
5961

6062
test: {
63+
reporters: ['default'],
6164
globals: true,
6265
setupFiles: 'src/tests/setup-tests.ts',
6366
environment: 'jsdom',

0 commit comments

Comments
 (0)