mirror of
https://github.com/iconoir-icons/iconoir
synced 2024-05-29 03:52:34 +02:00
Configure rollup bundle
- Add rollup config to bundle package - Bundled package contains package.json, cjs files, es files and d.ts file
This commit is contained in:
parent
c76fffd095
commit
81141b062d
787
packages/iconoir-react/package-lock.json
generated
787
packages/iconoir-react/package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -2,11 +2,16 @@
|
|||
"name": "iconoir-react",
|
||||
"version": "1.0.0",
|
||||
"description": "React library for Iconoir icon set",
|
||||
"main": "build/index.js",
|
||||
"module": "dist/index.js",
|
||||
"main": "dist/cjs/index.js",
|
||||
"module": "dist/es/index.js",
|
||||
"types": "dist/index.d.ts",
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"scripts": {
|
||||
"test": "echo Tests not currently set up",
|
||||
"build": "rm -rf src/icons && node bin/build.js"
|
||||
"build": "rm -rf src/icons && node bin/build.js",
|
||||
"dist": "rm -rf dist && npm run build && rollup -c rollup.config.js"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
@ -24,9 +29,14 @@
|
|||
"react": "^16.8.6 || ^17"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.14.3",
|
||||
"@babel/preset-react": "^7.13.13",
|
||||
"@rollup/plugin-babel": "^5.3.0",
|
||||
"@rollup/plugin-node-resolve": "^13.0.0",
|
||||
"prettier-eslint": "^9.0.0",
|
||||
"react": "^17.0.2",
|
||||
"rollup": "^2.48.0",
|
||||
"rollup-plugin-copy": "^3.4.0",
|
||||
"uppercamelcase": "^3.0.0"
|
||||
}
|
||||
}
|
||||
|
|
38
packages/iconoir-react/rollup.config.js
Normal file
38
packages/iconoir-react/rollup.config.js
Normal file
|
@ -0,0 +1,38 @@
|
|||
import resolve from '@rollup/plugin-node-resolve';
|
||||
import babel from '@rollup/plugin-babel';
|
||||
import copy from 'rollup-plugin-copy';
|
||||
|
||||
export default {
|
||||
external: ['react', 'prop-types'],
|
||||
input: 'src/index.js',
|
||||
output: [
|
||||
{
|
||||
dir: 'dist/cjs',
|
||||
format: 'cjs',
|
||||
exports: 'named',
|
||||
sourcemap: true,
|
||||
},
|
||||
{
|
||||
dir: 'dist/es',
|
||||
format: 'esm',
|
||||
exports: 'named',
|
||||
sourcemap: true,
|
||||
},
|
||||
],
|
||||
plugins: [
|
||||
resolve({
|
||||
extensions: ['.js', '.jsx', '.ts', '.tsx'],
|
||||
}),
|
||||
babel({
|
||||
babelHelpers: 'bundled',
|
||||
presets: ['@babel/react'],
|
||||
exclude: 'node_modules/**',
|
||||
extensions: ['.js', '.jsx', '.d.ts', '.tsx'],
|
||||
}),
|
||||
copy({
|
||||
targets: [
|
||||
{ src: 'src/index.d.ts', dest: 'dist' },
|
||||
],
|
||||
}),
|
||||
],
|
||||
};
|
Loading…
Reference in a new issue