-
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from mesqueeb/dev
BETA 1
- Loading branch information
Showing
19 changed files
with
22,511 additions
and
119 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
{ | ||
"presets": ["env"], | ||
"plugins": ["babel-plugin-transform-object-rest-spread"] | ||
} | ||
"presets": [ | ||
["env", { | ||
"modules": false | ||
}] | ||
], | ||
"plugins": ["external-helpers", "babel-plugin-transform-object-rest-spread"] | ||
} |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// ------------------------------------------------------------------------------------------ | ||
// setup | ||
// ------------------------------------------------------------------------------------------ | ||
import resolve from 'rollup-plugin-node-resolve' | ||
import babel from 'rollup-plugin-babel' | ||
import commonjs from 'rollup-plugin-commonjs' | ||
import { uglify } from 'rollup-plugin-uglify' | ||
|
||
const pkg = require('../package.json') | ||
const external = Object.keys(pkg.dependencies || {}) | ||
const name = 'index' | ||
const className = name.replace(/(^\w|-\w)/g, c => c.replace('-', '').toUpperCase()) | ||
|
||
function output (ext, format = 'umd') { | ||
return { | ||
name: className, | ||
file: `dist/${name}.${ext}`, | ||
format: format, | ||
sourcemap: true, | ||
exports: 'named', | ||
} | ||
} | ||
|
||
// ------------------------------------------------------------------------------------------ | ||
// build | ||
// ------------------------------------------------------------------------------------------ | ||
const umd = { | ||
input: 'src/index.js', | ||
external, | ||
output: output('js'), | ||
plugins: [ | ||
resolve(), | ||
commonjs(), | ||
babel({ | ||
exclude: 'node_modules/**' // only transpile our source code | ||
}) | ||
] | ||
} | ||
|
||
const min = Object.assign({}, umd, { | ||
output: output('min.js'), | ||
plugins: [...umd.plugins, uglify()] | ||
}) | ||
|
||
export default [umd, min] |
Oops, something went wrong.