-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from MiracleUFO/fix-build/build-error
Fix build/build error
- Loading branch information
Showing
6 changed files
with
1,600 additions
and
608 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
/* eslint-disable import/no-extraneous-dependencies */ | ||
// @ts-check | ||
|
||
/* eslint-env node */ | ||
import commonjs from '@rollup/plugin-commonjs'; | ||
import { nodeResolve } from '@rollup/plugin-node-resolve'; | ||
import nodePolyfills from 'rollup-plugin-polyfill-node'; | ||
import peerDepsExternal from 'rollup-plugin-peer-deps-external'; | ||
import typescript from '@rollup/plugin-typescript'; | ||
import terser from '@rollup/plugin-terser'; | ||
import dts from 'rollup-plugin-dts'; | ||
import json from '@rollup/plugin-json'; | ||
|
||
/** | ||
* Rollup configuration to build the main bundle. | ||
* @type {import('rollup').RollupOptions} | ||
*/ | ||
const mainConfig = { | ||
input: 'src/index.ts', | ||
output: [ | ||
{ | ||
file: 'dist/index.esm.js', | ||
format: 'esm', | ||
sourcemap: true, | ||
}, | ||
{ | ||
file: 'dist/index.js', | ||
format: 'cjs', | ||
sourcemap: true, | ||
}, | ||
{ | ||
file: 'dist/index.min.js', | ||
format: 'umd', | ||
name: 'DatePicker', | ||
plugins: [terser()], | ||
sourcemap: true, | ||
globals: { | ||
react: 'React', | ||
}, | ||
}, | ||
], | ||
external: ['react', 'react-dom'], | ||
plugins: [ | ||
peerDepsExternal(), | ||
nodeResolve(), | ||
commonjs(), | ||
json(), | ||
typescript({ | ||
tsconfig: './tsconfig.build.json', | ||
declaration: false, | ||
}), | ||
nodePolyfills(), | ||
], | ||
}; | ||
|
||
/** | ||
* Rollup configuration to build the type declaration file. | ||
* @type {import('rollup').RollupOptions} | ||
*/ | ||
export const dtsConfig = { | ||
input: 'src/index.ts', | ||
output: [{ file: 'dist/index.d.ts', format: 'es' }], | ||
plugins: [ | ||
dts({ | ||
tsconfig: './tsconfig.build.json', | ||
compilerOptions: { | ||
preserveSymlinks: false, | ||
}, | ||
}), | ||
], | ||
}; | ||
|
||
export default [mainConfig, dtsConfig]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"extends": "./tsconfig.json", | ||
"compilerOptions": { | ||
"rootDir": "./src" | ||
}, | ||
"exclude": ["**/*.test.*"], | ||
"include": ["./src/**/*"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters