generated from nl-design-system/example
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: switch to reusable rollup config for React components
- Loading branch information
Showing
45 changed files
with
339 additions
and
2,799 deletions.
There are no files selected for viewing
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,87 +1,3 @@ | ||
import babel from '@rollup/plugin-babel'; | ||
import commonjs from '@rollup/plugin-commonjs'; | ||
import json from '@rollup/plugin-json'; | ||
import resolve from '@rollup/plugin-node-resolve'; | ||
import typescript from '@rollup/plugin-typescript'; | ||
import { readFileSync } from 'fs'; | ||
import filesize from 'rollup-plugin-filesize'; | ||
import nodeExternal from 'rollup-plugin-node-externals'; | ||
import peerDepsExternal from 'rollup-plugin-peer-deps-external'; | ||
import postcss from 'rollup-plugin-postcss'; | ||
import { createConfig } from '@utrecht/build-utils-react/src/rollup.mjs'; | ||
|
||
const packagePath = new URL('./package.json', import.meta.url).pathname; | ||
const packageJson = JSON.parse(readFileSync(packagePath, 'utf8')); | ||
|
||
/** | ||
* @type {import('rollup').RollupOptions} | ||
*/ | ||
export default [ | ||
{ | ||
input: './src/index.tsx', | ||
output: [ | ||
{ | ||
file: packageJson.main, | ||
format: 'cjs', | ||
sourcemap: true, | ||
}, | ||
{ | ||
file: packageJson.module, | ||
format: 'es', | ||
sourcemap: true, | ||
}, | ||
], | ||
plugins: [ | ||
peerDepsExternal(), | ||
commonjs(), | ||
nodeExternal(), | ||
resolve({ browser: true }), | ||
json(), | ||
typescript({ tsconfig: './tsconfig.build.json' }), | ||
babel({ | ||
presets: ['@babel/preset-react'], | ||
babelHelpers: 'runtime', | ||
exclude: ['node_modules/**', 'dist/**'], | ||
extensions: ['.ts', '.tsx'], | ||
inputSourceMap: true, | ||
plugins: ['@babel/plugin-transform-runtime'], | ||
}), | ||
filesize(), | ||
], | ||
}, | ||
{ | ||
input: './src/css.tsx', | ||
output: [ | ||
{ | ||
file: './dist/css.js', | ||
format: 'cjs', | ||
sourcemap: true, | ||
}, | ||
{ | ||
file: './dist/css.mjs', | ||
format: 'es', | ||
sourcemap: true, | ||
}, | ||
], | ||
plugins: [ | ||
peerDepsExternal(), | ||
commonjs(), | ||
nodeExternal(), | ||
resolve({ browser: true }), | ||
json(), | ||
postcss({ | ||
extensions: ['.css', '.scss'], | ||
minimize: true, | ||
}), | ||
typescript({ tsconfig: './tsconfig.build.json' }), | ||
babel({ | ||
presets: ['@babel/preset-react'], | ||
babelHelpers: 'runtime', | ||
exclude: ['node_modules/**', 'dist/**'], | ||
extensions: ['.ts', '.tsx'], | ||
inputSourceMap: true, | ||
plugins: ['@babel/plugin-transform-runtime'], | ||
}), | ||
filesize(), | ||
], | ||
}, | ||
]; | ||
export default createConfig(); |
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
88 changes: 2 additions & 86 deletions
88
packages/components-react/calendar-react/rollup.config.mjs
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,87 +1,3 @@ | ||
import babel from '@rollup/plugin-babel'; | ||
import commonjs from '@rollup/plugin-commonjs'; | ||
import json from '@rollup/plugin-json'; | ||
import resolve from '@rollup/plugin-node-resolve'; | ||
import typescript from '@rollup/plugin-typescript'; | ||
import { readFileSync } from 'fs'; | ||
import filesize from 'rollup-plugin-filesize'; | ||
import nodeExternal from 'rollup-plugin-node-externals'; | ||
import peerDepsExternal from 'rollup-plugin-peer-deps-external'; | ||
import postcss from 'rollup-plugin-postcss'; | ||
import { createConfig } from '@utrecht/build-utils-react/src/rollup.mjs'; | ||
|
||
const packagePath = new URL('./package.json', import.meta.url).pathname; | ||
const packageJson = JSON.parse(readFileSync(packagePath, 'utf8')); | ||
|
||
/** | ||
* @type {import('rollup').RollupOptions} | ||
*/ | ||
export default [ | ||
{ | ||
input: './src/index.tsx', | ||
output: [ | ||
{ | ||
file: packageJson.main, | ||
format: 'cjs', | ||
sourcemap: true, | ||
}, | ||
{ | ||
file: packageJson.module, | ||
format: 'es', | ||
sourcemap: true, | ||
}, | ||
], | ||
plugins: [ | ||
peerDepsExternal(), | ||
commonjs(), | ||
nodeExternal(), | ||
resolve({ browser: true }), | ||
json(), | ||
typescript({ tsconfig: './tsconfig.build.json', outputToFilesystem: false }), | ||
babel({ | ||
presets: ['@babel/preset-react'], | ||
babelHelpers: 'runtime', | ||
exclude: ['node_modules/**', 'dist/**'], | ||
extensions: ['.ts', '.tsx'], | ||
inputSourceMap: true, | ||
plugins: ['@babel/plugin-transform-runtime'], | ||
}), | ||
filesize(), | ||
], | ||
}, | ||
{ | ||
input: './src/css.tsx', | ||
output: [ | ||
{ | ||
file: './dist/css.cjs', | ||
format: 'cjs', | ||
sourcemap: true, | ||
}, | ||
{ | ||
file: './dist/css.mjs', | ||
format: 'es', | ||
sourcemap: true, | ||
}, | ||
], | ||
plugins: [ | ||
peerDepsExternal(), | ||
commonjs(), | ||
nodeExternal(), | ||
resolve({ browser: true }), | ||
json(), | ||
postcss({ | ||
extensions: ['.css', '.scss'], | ||
minimize: true, | ||
}), | ||
typescript({ tsconfig: './tsconfig.build.json', outputToFilesystem: false }), | ||
babel({ | ||
presets: ['@babel/preset-react'], | ||
babelHelpers: 'runtime', | ||
exclude: ['node_modules/**', 'dist/**'], | ||
extensions: ['.ts', '.tsx'], | ||
inputSourceMap: true, | ||
plugins: ['@babel/plugin-transform-runtime'], | ||
}), | ||
filesize(), | ||
], | ||
}, | ||
]; | ||
export default createConfig(); |
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
88 changes: 2 additions & 86 deletions
88
packages/components-react/checkbox-group-react/rollup.config.mjs
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,87 +1,3 @@ | ||
import babel from '@rollup/plugin-babel'; | ||
import commonjs from '@rollup/plugin-commonjs'; | ||
import json from '@rollup/plugin-json'; | ||
import resolve from '@rollup/plugin-node-resolve'; | ||
import typescript from '@rollup/plugin-typescript'; | ||
import { readFileSync } from 'fs'; | ||
import filesize from 'rollup-plugin-filesize'; | ||
import nodeExternal from 'rollup-plugin-node-externals'; | ||
import peerDepsExternal from 'rollup-plugin-peer-deps-external'; | ||
import postcss from 'rollup-plugin-postcss'; | ||
import { createConfig } from '@utrecht/build-utils-react/src/rollup.mjs'; | ||
|
||
const packagePath = new URL('./package.json', import.meta.url).pathname; | ||
const packageJson = JSON.parse(readFileSync(packagePath, 'utf8')); | ||
|
||
/** | ||
* @type {import('rollup').RollupOptions} | ||
*/ | ||
export default [ | ||
{ | ||
input: './src/index.tsx', | ||
output: [ | ||
{ | ||
file: packageJson.main, | ||
format: 'cjs', | ||
sourcemap: true, | ||
}, | ||
{ | ||
file: packageJson.module, | ||
format: 'es', | ||
sourcemap: true, | ||
}, | ||
], | ||
plugins: [ | ||
peerDepsExternal(), | ||
commonjs(), | ||
nodeExternal(), | ||
resolve({ browser: true }), | ||
json(), | ||
typescript({ tsconfig: './tsconfig.build.json' }), | ||
babel({ | ||
presets: ['@babel/preset-react'], | ||
babelHelpers: 'runtime', | ||
exclude: ['node_modules/**', 'dist/**'], | ||
extensions: ['.ts', '.tsx'], | ||
inputSourceMap: true, | ||
plugins: ['@babel/plugin-transform-runtime'], | ||
}), | ||
filesize(), | ||
], | ||
}, | ||
{ | ||
input: './src/css.tsx', | ||
output: [ | ||
{ | ||
file: './dist/css.cjs', | ||
format: 'cjs', | ||
sourcemap: true, | ||
}, | ||
{ | ||
file: './dist/css.mjs', | ||
format: 'es', | ||
sourcemap: true, | ||
}, | ||
], | ||
plugins: [ | ||
peerDepsExternal(), | ||
commonjs(), | ||
nodeExternal(), | ||
resolve({ browser: true }), | ||
json(), | ||
postcss({ | ||
extensions: ['.css', '.scss'], | ||
minimize: true, | ||
}), | ||
typescript({ tsconfig: './tsconfig.build.json' }), | ||
babel({ | ||
presets: ['@babel/preset-react'], | ||
babelHelpers: 'runtime', | ||
exclude: ['node_modules/**', 'dist/**'], | ||
extensions: ['.ts', '.tsx'], | ||
inputSourceMap: true, | ||
plugins: ['@babel/plugin-transform-runtime'], | ||
}), | ||
filesize(), | ||
], | ||
}, | ||
]; | ||
export default createConfig(); |
Oops, something went wrong.