Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Commit

Permalink
rollup config
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed May 29, 2020
1 parent 52f570a commit 004185a
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import resolve from '@rollup/plugin-node-resolve'
import commonjs from '@rollup/plugin-commonjs'
import coffeescript from 'rollup-plugin-coffee-script'
import {terser} from 'rollup-plugin-terser'

let plugins = [
// if any (in deps as well): Convert CoffeeScript to JavaScript
coffeescript(),

// so Rollup can find externals
resolve({extensions: ['.js', '.coffee'], preferBuiltins: true}),

// so Rollup can convert externals to an ES module
commonjs()
]

// minify only in production mode
if (process.env.NODE_ENV === 'production') {
plugins.push(
// minify
terser({
ecma: 2018,
warnings: true,
compress: {
drop_console: false
}
})
)
}

export default [
{
input: 'lib/main',
output: [
{
dir: 'dist',
format: 'cjs',
sourcemap: true
}
],
// loaded externally
external: [
'atom',
'pathwatcher',
// node stuff
'fs',
'path'
],
plugins: plugins
}
]

0 comments on commit 004185a

Please sign in to comment.