-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: remove support for rr 4, dependencies, and build improvements (#…
…122) * chore: remove support for rr 4, dependencies, and build improvements * fix: small improvement to UMD build * chore: remove unnecessary dependency Co-authored-by: Justin Schrader <[email protected]>
- Loading branch information
1 parent
9d2e185
commit b4c539a
Showing
9 changed files
with
1,186 additions
and
1,772 deletions.
There are no files selected for viewing
10 changes: 5 additions & 5 deletions
10
.yarn/releases/yarn-berry.cjs → .yarn/releases/yarn-2.4.2.cjs
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
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
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 |
---|---|---|
@@ -1,57 +1,51 @@ | ||
import babel from 'rollup-plugin-babel'; | ||
import commonjs from '@rollup/plugin-commonjs'; | ||
import resolve from '@rollup/plugin-node-resolve'; | ||
import typescript from 'rollup-plugin-typescript2'; | ||
import ts from 'typescript'; | ||
import babel from '@rollup/plugin-babel'; | ||
import typescript from '@rollup/plugin-typescript'; | ||
import size from 'rollup-plugin-size'; | ||
import { terser } from 'rollup-plugin-terser'; | ||
|
||
const pkg = require('./package.json'); | ||
|
||
const external = Object.keys(pkg.peerDependencies); | ||
const external = Object.keys(pkg.peerDependencies).concat(/@babel\/runtime/); | ||
|
||
const extensions = ['.js', '.tsx']; | ||
|
||
const plugins = [ | ||
typescript({ | ||
useTsconfigDeclarationDir: true, | ||
tsconfigOverride: { | ||
typescript: ts, | ||
compilerOptions: { | ||
module: 'es2015', | ||
}, | ||
}, | ||
}), | ||
const sharedPlugins = [ | ||
typescript(), | ||
babel({ | ||
babelHelpers: 'runtime', | ||
exclude: 'node_modules/**', | ||
extensions, | ||
}), | ||
resolve({ | ||
mainFields: ['module', 'main', 'umd'], | ||
extensions, | ||
}), | ||
size(), | ||
]; | ||
|
||
const formats = [ | ||
{ format: 'cjs', file: pkg.main, plugins: plugins.concat([commonjs(), terser()]) }, | ||
{ format: 'umd', file: pkg.umd, plugins: plugins.concat([commonjs(), terser()]) }, | ||
{ format: 'es', file: pkg.module, plugins }, | ||
{ format: 'umd', file: pkg.umd, plugins: sharedPlugins.concat([terser({ format: { comments: false } })]) }, | ||
{ format: 'cjs', file: pkg.main, plugins: sharedPlugins }, | ||
{ format: 'es', file: pkg.module, plugins: sharedPlugins }, | ||
]; | ||
|
||
const globals = { | ||
react: 'React', | ||
'react-router': 'ReactRouter', | ||
}; | ||
|
||
export default formats.map((item) => ({ | ||
export default formats.map(({ plugins, file, format }) => ({ | ||
input: 'src/index.tsx', | ||
plugins: item.plugins, | ||
plugins, | ||
external, | ||
output: { | ||
exports: 'named', | ||
file: item.file, | ||
format: item.format, | ||
file, | ||
format, | ||
name: 'react-router-breadcrumbs-hoc', | ||
globals, | ||
sourcemap: true, | ||
globals: format !== 'umd' | ||
? globals | ||
: { | ||
...globals, | ||
'@babel/runtime/helpers/toConsumableArray': '_toConsumableArray', | ||
'@babel/runtime/helpers/defineProperty': '_defineProperty', | ||
'@babel/runtime/helpers/objectWithoutProperties': '_objectWithoutProperties', | ||
}, | ||
}, | ||
})); |
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
Oops, something went wrong.