Skip to content

Instantly share code, notes, and snippets.

@gnimmelf
Created February 12, 2018 22:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gnimmelf/af51fd4e6a9cac6b63db5d9b1839fc3e to your computer and use it in GitHub Desktop.
Save gnimmelf/af51fd4e6a9cac6b63db5d9b1839fc3e to your computer and use it in GitHub Desktop.
Rollup config
import fs from 'fs';
import path from 'path';
// rollup.config.js
import builtins from 'rollup-plugin-node-builtins';
import globals from 'rollup-plugin-node-globals';
import babel from 'rollup-plugin-babel';
import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import replace from 'rollup-plugin-replace';
import uglify from 'rollup-plugin-uglify';
import { minify as esMinifier } from 'uglify-es';
import json from 'rollup-plugin-json';
import async from 'rollup-plugin-async';
import analyze from 'rollup-analyzer-plugin'
// PostCss
import postcss from 'rollup-plugin-postcss';
import simplevars from 'postcss-simple-vars';
import nested from 'postcss-nested';
import cssnext from 'postcss-cssnext';
import cssnano from 'cssnano';
import lost from 'lost';
const fileCopy = function (options) {
return {
ongenerate(){
const targDir = path.dirname(options.targ);
if (!fs.existsSync(targDir)){
fs.mkdirSync(targDir);
}
fs.writeFileSync(options.targ, fs.readFileSync(options.src));
}
};
};
const ENV = process.env.NODE_ENV || 'development';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment