0.0.20 • Published 5 years ago
@barusu-react/rollup-config v0.0.20
Install
yarn add --dev @barusu-react/rollup-configUsage
Use in
rollup.config.jsimport path from 'path' import { createPreprocessorConfig, createRollupConfig, } from '@barusu-react/rollup-config' import manifest from './package.json' const resolvePath = p => path.resolve(__dirname, p) const paths = { source: { stylesheetInput: [ resolvePath('src/style/index.styl'), ], assetsRoot: resolvePath('src/assets'), }, eslintrc: resolvePath('.eslintrc.js'), tsconfig: resolvePath('tsconfig.src.json'), } const preprocessorConfig = createPreprocessorConfig({ input: paths.source.stylesheetInput, pluginOptions: { multiEntryOptions: { exports: false, }, postcssOptions: { modules: { localsConvention: 'camelCase', }, } }, }) const config = createRollupConfig({ manifest, pluginOptions: { typescriptOptions: { tsconfig: paths.tsconfig, }, postcssOptions: { extract: false, minimize: true, modules: { localsConvention: 'camelCase', generateScopedName: 'barusu-[local]', }, pluginOptions: { postcssUrlOptions: { url: 'inline', basePath: paths.source.assetsRoot, } }, } } }) const resolvedConfig = [preprocessorConfig, config] export default resolvedConfig
Examples
Options
preprocessOptions
input: Input config- type:
string | string[] | { include?: string[], exclude?: string } - required:
true - see Supported Input Types
- type:
output: Output config- type:
rollup.OutputOptions | rollup.OutputOptions[] - required:
false
- type:
pluginOptions:property required description multiEntryOptionsfalseoptions for @rollup/plugin-multi-entry postcssOptionsfalseoptions for @barusu-react/rollup-plugin-postcss-dts
Options of createRollupConfig
useSourceMap: Whether to generate sourceMap (includes declarationMap)- type:
boolean - default: true
- type:
externalAllDependencies: Whether to exhaust all dependencies (include dependencies of child dependency)- type:
boolean - default: true
- type:
manifestproperty type required description sourcestringtruesource entry file mainstringfalsetarget entry file of cjs modulestringfalsetarget entry file of es dependencies{[key: string]: string}falseignore these dependencies ( external)pluginOptionsproperty required description jsonOptionsfalseoptions for @rollup/plugin-json nodeResolveOptionsfalseoptions for @rollup/plugin-node-resolve typescriptOptionsfalseoptions for rollup-plugin-typescript2 commonjsOptionsfalseoptions for @rollup/plugin-commonjs peerDepsExternalOptionsfalseoptions for rollup-plugin-peer-deps-external postcssOptionsfalseoptions for @barusu-react/rollup-plugin-postcss-dts
0.0.20
5 years ago
0.0.19
5 years ago
0.0.18
5 years ago
0.0.17
5 years ago
0.0.16
5 years ago
0.0.15
5 years ago
0.0.14
5 years ago
0.0.12
5 years ago
0.0.13
5 years ago
0.0.11
5 years ago
0.0.10
5 years ago
0.0.9
5 years ago
0.0.8
5 years ago
0.0.7
6 years ago
0.0.6
6 years ago
0.0.5
6 years ago
0.0.4
6 years ago
0.0.3
6 years ago
0.0.2
6 years ago
0.0.1
6 years ago