1.0.8 • Published 1 year ago
@optic-builder/bundler-cli v1.0.8
Build Module App with rollup
Pre-configured setup for building applications and modules with Rollup.
# How to use
Create a JSON file and apply the following configuration.
config.json
{
"nameModule" : "MyLibrary",
"input" : "src/index.ts",
"dirMain" : "lib",
"externalConfig" : [["react","React"],["styled-components","styled"]],
"outputs" : {
"main" : {
"name" : "index.js",
"format" : "cjs"
},
"module" : {
"name" : "index.es.js",
"format" : "es"
},
"browser" : {
"name" : "index.umd.js",
"format" : "umd"
},
"declaration" : {
"name" : "index.d.ts",
"format" : "cjs"
}
},
"alias" : {
"src": "./src"
},
"tsconfig" : "tsconfig.json",
"watch" : false,
"warn" : true,
"pkgJsonScripts": {
"test": "react-scripts start"
},
"resolve": {
"browser": true
},
"copyTargets": [
{ "src": 'README.md', "dest": 'lib' }
],
"polyfillModules" : ["node-fetch"],
// "pathPkg" : "example",
}
command
app-rollup-cli --config config.json
for package.json
{
...,
"scripts" : {
"build" : "app-rollup-cli --config config.json"
}
}