Skip to content

Instantly share code, notes, and snippets.

@raffecat
Created March 23, 2019 09:44
Show Gist options
  • Save raffecat/3848ee87069e4a158b80a84e80b04578 to your computer and use it in GitHub Desktop.
Save raffecat/3848ee87069e4a158b80a84e80b04578 to your computer and use it in GitHub Desktop.
Rollup Config for Buble with ESLint
import eslint from 'rollup-plugin-eslint';
import buble from 'rollup-plugin-buble';
export default {
input: 'src/entry.js',
output: {
file: 'dist/bundle.js',
format: 'iife'
},
plugins: [
eslint({}),
buble({
transforms: {
dangerousForOf: true
},
namedFunctionExpressions: false
})
]
};
@raffecat
Copy link
Author

.eslintrc.json

{
  "extends": "eslint:recommended",
  "env": {
    "browser": true
  },
  "globals": {
    "$":false
  },
  "rules": {
    "no-constant-condition": 0
  },
  "parserOptions": {
    "ecmaVersion": 5,
    "sourceType": "module",
    "ecmaFeatures": {
      "impliedStrict": true
    }
  }
}

@raffecat
Copy link
Author

package.json

  "dependencies": {
    "rollup": "^0.50.0",
    "rollup-plugin-buble": "^0.15.0",
    "rollup-plugin-eslint": "^4.0.0",
    "rollup-plugin-uglify": "^2.0.1"
  }

@raffecat
Copy link
Author

Uglify and TypeScript

import uglify from 'rollup-plugin-uglify';
import typescript from 'rollup-plugin-typescript2';

export default {
  plugins: [
    typescript(),
    eslint({}),
    buble(),
    uglify()
  ]
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment