Merge pull request #924 from datopian/fix-redeclaration-of-formal-parameter-error

[packages/components][m] - fix error on build
This commit is contained in:
João Demenech
2023-06-05 16:22:09 -03:00
committed by GitHub
5 changed files with 1699 additions and 262 deletions

View File

@@ -0,0 +1,5 @@
---
'@portaljs/components': patch
---
Fixed redeclaration of formal parameter "x" error after next build

1236
package-lock.json generated

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -34,8 +34,10 @@
"react-hook-form": "^7.43.9", "react-hook-form": "^7.43.9",
"react-query": "^3.39.3", "react-query": "^3.39.3",
"react-vega": "^7.6.0", "react-vega": "^7.6.0",
"rollup-plugin-re": "^1.0.7",
"vega": "5.25.0", "vega": "5.25.0",
"vega-lite": "5.1.0" "vega-lite": "5.1.0",
"vitest": "^0.31.4"
}, },
"devDependencies": { "devDependencies": {
"@storybook/addon-essentials": "^7.0.7", "@storybook/addon-essentials": "^7.0.7",

View File

@@ -1,15 +1,38 @@
import react from '@vitejs/plugin-react'; import react from '@vitejs/plugin-react'
import path from 'node:path'; import path from 'node:path'
import { defineConfig } from 'vite'; import { defineConfig } from 'vitest/config'
import dts from 'vite-plugin-dts'; 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: [ plugins: [
react(), 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({ dts({
insertTypesEntry: true, insertTypesEntry: true,
}), }),
], ],
css: {
postcss: {
plugins: [tailwindcss],
},
},
build: { build: {
lib: { lib: {
entry: path.resolve(__dirname, 'src/index.ts'), entry: path.resolve(__dirname, 'src/index.ts'),
@@ -18,13 +41,21 @@ export default defineConfig({
fileName: (format) => `components.${format}.js`, fileName: (format) => `components.${format}.js`,
}, },
rollupOptions: { rollupOptions: {
external: ['react', 'react-dom', 'styled-components'], external: ['react', 'react-dom', 'tailwindcss', 'vega-lite', 'vega', 'react-vega'],
output: { output: {
globals: { globals: {
react: 'React', react: 'React',
'react-dom': 'ReactDOM' 'react-dom': 'ReactDOM',
tailwindcss: 'tailwindcss',
}, },
}, },
}, },
}, },
}); test: {
globals: true,
environment: 'jsdom',
},
})
}
// https://vitejs.dev/config/
export default app