Skip to content

Commit

Permalink
feat: 📝 many options for customization added
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven Truesdell committed Jul 31, 2017
1 parent 1731be8 commit 1495a82
Show file tree
Hide file tree
Showing 8 changed files with 742 additions and 379 deletions.
3 changes: 3 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": [ "." ]
}
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules/
.babelrc
97 changes: 65 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,45 +1,78 @@
# babel-preset-boldr

Babel preset for [Boldr](https://github.com/strues/boldr)
Babel preset for [Boldr](https://github.com/strues/boldr).

**Browser default options**:
```json
{
"debug": false,
"loose": false,
"modules": false,
"targets": {
"uglify": true,
"browsers": ["> .5% in US", "last 1 versions"],
`babel-plugin-universal-import` and `babel-plugin-styled-components` are included and enabled by default. If you don't need them,
they can be disabled by passing `universal: false` and/or `styled: false` to the preset's options.


### Options
```javascript
const defaults = {
// log output to the console
verbose: false,
// es modules enabled/disabled -- accepts: commonjs, false, umd, etc
modules: false,
// Prefer built-ins over custom code. This mainly benefits for modern engines.
useBuiltIns: true,
// Whether to enable source map output
sourceMaps: true,
// Enable full compression on production scripts or basic compression for libraries or during development.
compression: false,
// Keeping comments to be compatible with Webpack's magic comments
comments: true,
// Do not apply general minification by default
minified: true,
// Env Settings
looseMode: true,
specMode: false,
// transform-runtime
// -- generators
regen: false,
// -- helpers
rtHelpers: false,
// -- require polyfill
polyfill: false,
// fast async
// -- transpile using spec helpers -- no run time required, but slower.
// --- !!! MUST be false if nodentRt is true
faSpecMode: true,
// -- use nodent runtime for async/await - much faster than babel
nodentRt: false,
targets: {
uglify: true,
browsers: 'last 2 versions',
},
"exclude": ["transform-regenerator", "transform-async-to-generator"],
"useBuiltIns": true
},
exclude: ['transform-regenerator', 'transform-async-to-generator'],
// Lodash Plugin Settings
lodashInc: ['lodash', 'async', 'ramda', 'recompose'],
styled: true,
universal: true,
}
```

**Node default options**:
**Browser default options**:
```json
{
"debug": false,
"loose": false,
"modules": false,
"targets": {
"node": 8,
},
"exclude": ["transform-regenerator", "transform-async-to-generator"],
"useBuiltIns": true
},
[
["boldr", {
"verbose": false,
"modules": false,
"useBuiltIns": true,
"targets": { "browsers": "last 2 versions"}
}]
]
```

**Modifying the options**:
**Node default options**:
```json
{
"presets": [["boldr/node", {
"targets": {
"node": 7
}
}]]
}
[
["boldr", {
"verbose": false,
"modules": false,
"useBuiltIns": true,
"targets": { "node": "current"}
}]
]
```

**Included Presets:**
Expand Down
Loading

0 comments on commit 1495a82

Please sign in to comment.