Merge pull request #924 from datopian/fix-redeclaration-of-formal-parameter-error
[packages/components][m] - fix error on build
This commit is contained in:
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-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",
|
||||||
|
|||||||
@@ -1,30 +1,61 @@
|
|||||||
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(),
|
||||||
dts({
|
replace({
|
||||||
insertTypesEntry: true,
|
patterns: [
|
||||||
}),
|
{
|
||||||
],
|
match: /js-sha256/,
|
||||||
build: {
|
test: `eval("require('crypto')")`,
|
||||||
lib: {
|
replace: `require('crypto')`,
|
||||||
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'
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
{
|
||||||
|
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
|
||||||
|
|||||||
Reference in New Issue
Block a user