Created
February 12, 2018 22:18
-
-
Save gnimmelf/af51fd4e6a9cac6b63db5d9b1839fc3e to your computer and use it in GitHub Desktop.
Rollup config
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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