Skip to content
This repository was archived by the owner on Jan 9, 2023. It is now read-only.

Commit

Permalink
feat: support ignore plugin by filter
Browse files Browse the repository at this point in the history
  • Loading branch information
wmzy committed May 10, 2019
0 parents commit 23b7cfc
Show file tree
Hide file tree
Showing 14 changed files with 7,870 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# http://editorconfig.org

root = true

[*]

# Change these settings to your own preference
indent_style = space
indent_size = 2

# We recommend you to keep these unchanged
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false


[Makefile]
indent_style = tab
indent_size = 4
26 changes: 26 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
module.exports = {
root: true,
env: {
"browser": true,
"node": true,
"commonjs": true,
"es6": true
},
plugins: ['prettier'],
extends: [
'airbnb-base',
'eslint-config-prettier'
],
rules: {
'prettier/prettier': ['error'],
'no-return-assign': ['error', 'except-parens'],
'no-shadow': 'off',
'no-param-reassign': 'off',
'no-use-before-define': ["error", { "functions": false }],
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'warn',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
},
parserOptions: {
parser: 'babel-eslint'
}
}
27 changes: 27 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Include your project-specific ignores in this file
# Read about how to use .gitignore: https://help.github.com/articles/ignoring-files

build
database.sqlite
node_modules
ncp-debug.log
npm-debug.log

# nyc
coverage
.nyc_output

# IDE
.idea
.vscode

.DS_Store

tmp

*.zip
*.tgz

/.nyc_output

/dist
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test
4 changes: 4 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"singleQuote": true,
"bracketSpacing": false
}
11 changes: 11 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
language: node_js

node_js:
- "node"
- "lts/*"

cache:
directories:
- "node_modules"
after_script:
- npm run coverage
64 changes: 64 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
[![Build Status](https://travis-ci.org/wmzy/rollup-plugin-by-output.svg?branch=master)](https://travis-ci.org/wmzy/rollup-plugin-by-output)
[![Coverage Status](https://coveralls.io/repos/github/wmzy/rollup-plugin-by-output/badge.svg?branch=master)](https://coveralls.io/github/wmzy/rollup-plugin-by-output?branch=master)
# rollup-plugin-by-output

> Apply Rollup Plugin by OutputOptions
## Install

```bash
npm i -D rollup-plugin-by-output
```

## Usage

```bash
// rollup.config.js
import babel from 'rollup-plugin-babel';
import terser from 'rollup-plugin-terser';
import plugins from 'rollup-plugin-by-output';


export default {
// ...
plugins: plugins(babel(), [o => (o.file === pkg.browser), terser()]),
output: {
globals: {
lodash: '_'
},
name: pkg.name,
file: pkg.browser,
format: 'umd'
},
output: [
{
file: pkg.main,
format: 'cjs'
},
{
file: pkg.module,
format: 'es'
}
]
};

```
## Workflow
```bash
# develop
npm start

# build
npm run build

# test
npm test

# commit changes
npm run commit

# publish
npm publish
```
15 changes: 15 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const pkg = require('./package');

module.exports = {
presets: [
[
'@babel/env',
{
modules: false,
targets: {
node: pkg.engines.node
}
}
]
]
};
Loading

0 comments on commit 23b7cfc

Please sign in to comment.