[packages/components][m] - fix error on build
This commit is contained in:
parent
7a46a6732b
commit
959fe5a588
5
.changeset/clever-jeans-wonder.md
Normal file
5
.changeset/clever-jeans-wonder.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'@portaljs/components': patch
|
||||
---
|
||||
|
||||
Fixed redeclaration of formal parameter "x" error after next build
|
||||
1236
package-lock.json
generated
1236
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
633
packages/components/package-lock.json
generated
633
packages/components/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -34,8 +34,10 @@
|
||||
"react-hook-form": "^7.43.9",
|
||||
"react-query": "^3.39.3",
|
||||
"react-vega": "^7.6.0",
|
||||
"rollup-plugin-re": "^1.0.7",
|
||||
"vega": "5.25.0",
|
||||
"vega-lite": "5.1.0"
|
||||
"vega-lite": "5.1.0",
|
||||
"vitest": "^0.31.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@storybook/addon-essentials": "^7.0.7",
|
||||
|
||||
@ -1,30 +1,61 @@
|
||||
import react from '@vitejs/plugin-react';
|
||||
import path from 'node:path';
|
||||
import { defineConfig } from 'vite';
|
||||
import dts from 'vite-plugin-dts';
|
||||
import react from '@vitejs/plugin-react'
|
||||
import path from 'node:path'
|
||||
import { defineConfig } from 'vitest/config'
|
||||
import dts from 'vite-plugin-dts'
|
||||
import tailwindcss from 'tailwindcss'
|
||||
import { UserConfigExport } from 'vite'
|
||||
import replace from "rollup-plugin-re"
|
||||
|
||||
export default defineConfig({
|
||||
const app = async (): Promise<UserConfigExport> => {
|
||||
return defineConfig({
|
||||
plugins: [
|
||||
react(),
|
||||
dts({
|
||||
insertTypesEntry: true,
|
||||
}),
|
||||
],
|
||||
build: {
|
||||
lib: {
|
||||
entry: path.resolve(__dirname, 'src/index.ts'),
|
||||
name: 'components',
|
||||
formats: ['es', 'umd'],
|
||||
fileName: (format) => `components.${format}.js`,
|
||||
},
|
||||
rollupOptions: {
|
||||
external: ['react', 'react-dom', 'styled-components'],
|
||||
output: {
|
||||
globals: {
|
||||
react: 'React',
|
||||
'react-dom': 'ReactDOM'
|
||||
},
|
||||
react(),
|
||||
replace({
|
||||
patterns: [
|
||||
{
|
||||
match: /js-sha256/,
|
||||
test: `eval("require('crypto')")`,
|
||||
replace: `require('crypto')`,
|
||||
},
|
||||
},
|
||||
{
|
||||
match: /js-sha256/,
|
||||
test: `eval("require('buffer').Buffer")`,
|
||||
replace: `require('buffer').Buffer`,
|
||||
},
|
||||
],
|
||||
}),
|
||||
dts({
|
||||
insertTypesEntry: true,
|
||||
}),
|
||||
],
|
||||
css: {
|
||||
postcss: {
|
||||
plugins: [tailwindcss],
|
||||
},
|
||||
},
|
||||
});
|
||||
build: {
|
||||
lib: {
|
||||
entry: path.resolve(__dirname, 'src/index.ts'),
|
||||
name: 'components',
|
||||
formats: ['es', 'umd'],
|
||||
fileName: (format) => `components.${format}.js`,
|
||||
},
|
||||
rollupOptions: {
|
||||
external: ['react', 'react-dom', 'tailwindcss', 'vega-lite', 'vega', 'react-vega'],
|
||||
output: {
|
||||
globals: {
|
||||
react: 'React',
|
||||
'react-dom': 'ReactDOM',
|
||||
tailwindcss: 'tailwindcss',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
test: {
|
||||
globals: true,
|
||||
environment: 'jsdom',
|
||||
},
|
||||
})
|
||||
}
|
||||
// https://vitejs.dev/config/
|
||||
export default app
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user