Skip to content

Commit

Permalink
Migrate to rollup v0.48
Browse files Browse the repository at this point in the history
  • Loading branch information
ClassicOldSong committed Aug 24, 2017
1 parent 1678b80 commit 7f528b7
Show file tree
Hide file tree
Showing 13 changed files with 1,016 additions and 671 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ trim_trailing_whitespace = true

[package.json]
indent_style = space

[.travis.yml]
indent_style = space
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,6 @@ src/bplayer.old.js

# Binaries
test/bplayer.dev.js
test/bplayer.dev.js.map
dist/bplayer.min.js
dist/bplayer.min.js.map
28 changes: 28 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
script: npm run build
language: node_js
node_js:
- '8'
env:
- BUILD_ENV=CI
cache:
directories:
- node_modules
notifications:
webhooks: https://fathomless-fjord-24024.herokuapp.com/notify
deploy:
- provider: releases
api_key:
secure: cnvG4KkrfRlwhN/eGb/ULkdde2jwy/4B0owe+8Cf3KMA9ip1UDoB7pb6DMSApGkN5IguFnIrAG+mnGHauaEDrrog266Tt7iC5QWLti9XOYpvGZ2rAUn4YARFEsDH9oepSNbs5jKgoCYcT/mXQVnDRDY/rID0+TE/Ku3hMlKLomM2q1Kmmxc+/anzXLHRGH5x2OJ56Hv0oZ324/t3oQkzq3k8eHCdyg+FshPjTeWBz6nU18XP6LjLHcsOoQ3tI1y0KCKkKZBEok5LTOhk4zbO3PxfsHdycwiHcsDVbSKbSRv5xZtm8258H1+oZB8LVOqOzce9MaNaOjAUjCNOsEfxHQhDiJVD6QguD9T7s9a2ssDJwGa0GXg+iMpVGCxdmBattRodDBzJ+9tLeuvwS6iweroNnDjBDCj14hjZd9dv/8rI+6axVjYEf9jZGIj1TdW460GdMx7Qbz+eYHNdgD7rRKrQlE/zZ29sxZhQpN/V0/1/CnvlRfvtWrZSfzD/S/XJrjQMm9Nn7dORJpenuIhleBRFUks739c2JxQc6KV3smMH6gRmmW00uysiRhZlijFl8dnHLQo8xkQUv++jGMpPq/6otBA3IIKBJh2a5H/o09ItI6nFBK/+bG7vX6RULmzPCMOgE37AbmGwGFb+0K+GT9qKwPt7X5TjSzGwn2p30h0=
file:
- dist/bplayer.min.js
- dist/bplayer.min.js.map
skip_cleanup: true
on:
tags: true
- provider: npm
email: [email protected]
api_key:
secure: QgbfIiR03WAoKd95HLzVXRPV4ttGWTd/uiBh8M0OzA8lsefNGzkhTcbyQELdlFeo4KUD4r2JWalmmT0VYipBmzFVwI88ty3QKvdRuPPw0lQZX4T2L0xVZ/EPWwd4B68hiEaglbEy5GBa/fw8HmEiOnmBzpO2YccefZHTxgmrXUR6tMr6g9nNcF03XyZbqwQlvlx2lirYnGs0/W/4ccXG4UoMd1B9rnTLwAbfXy1Lzw7QG2SH6Qo7JArhuZTCggIUtSakMTPT+YqbZs4QRBIAwc//X3QMUw3vTkmmzRwmoxx0zTlz0LbkauLMfqLsFk8vAz+mmcXluRwB4ghdbLB14fLgAWFTfc0KAQooZRrvw614u1EAxCsT1EMw1riMxFmdzHop9Ftg9iIhNdEFhD25MTjXfcFgVifqXTot3ZEu9qXcTPUhSP8aEXMyG2zam1EXam7ue6PGM/XtX+xUQ2IM/Vc28s22ZsZQQ99UU7vUb513ZBfKEDTZyJDHQImBrfMEisQ4Mnn6I6QAJAPiklOMO2pIF47mu1FCiFfuWl3WWb4SvlWXk4sMUjXU2+rPPs94948zLYrWO0BSbV5529YQRjKR501lXVcQbOrH3SRMJfE2aWoM6DxnJxgX7RqRyu6ObLn5QRzpI7biKJ3fFNudidAkoH3GtSc0hAjjitYkB50=
skip_cleanup: true
on:
branch: master
25 changes: 0 additions & 25 deletions build/build.js

This file was deleted.

47 changes: 0 additions & 47 deletions build/dev-server.js

This file was deleted.

2 changes: 1 addition & 1 deletion config/bs-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
|
|
*/
module.exports = {
export default {
"ui": false,
"files": "test/index.html",
"watchOptions": {},
Expand Down
82 changes: 82 additions & 0 deletions config/rollup.base.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
import chalk from 'chalk'

// Rollup plugins
import buble from 'rollup-plugin-buble'
import eslint from 'rollup-plugin-eslint'
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 progress from 'rollup-plugin-progress'
import postcss from 'rollup-plugin-postcss'
import html from 'rollup-plugin-html'
import json from 'rollup-plugin-json'

// Log build environment
console.log('Target:', chalk.bold.green(process.env.NODE_ENV || 'development'))
switch (process.env.BUILD_ENV) {
case 'DEV': {
console.log(chalk.cyan`
+---------------+
| DEVELOP BUILD |
+---------------+
`)
break
}
case 'CI': {
console.log(chalk.green`
+----------+
| CI BUILD |
+----------+
`)
break
}
default: {
console.log(chalk.yellow`
+--------------+
| NORMAL BUILD |
+--------------+
`)
}
}

export default {
input: 'src/bplayer.js',
output: {
name: 'bPlayer',
format: 'umd',
sourcemap: true,
},
devDest: 'test/bplayer.dev.js',
proDest: 'dist/bplayer.min.js',
plugins: [
progress({
clearLine: false
}),
resolve({
jsnext: true,
main: true,
browser: true,
}),
commonjs(),
json(),
html({
include: 'src/*.html'
}),
postcss(),
eslint({
exclude: ['**/*.html', '**/*.css', '**/*.json']
}),
buble({
transforms: {
modules: false,
dangerousForOf: true
},
objedtAssign: 'Object.assign'
}),
replace({
ENV: `'${process.env.NODE_ENV || 'development'}'`
}),
(process.env.NODE_ENV === 'production' && uglify())
]
}
50 changes: 0 additions & 50 deletions config/rollup.config.js

This file was deleted.

15 changes: 15 additions & 0 deletions config/rollup.dev.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Import base config
import base from './rollup.base'
// Import browsersync config
import bsConfig from './bs-config'
// Import dev plugins
import browsersync from 'rollup-plugin-browsersync'

base.output.file = base.devDest
base.plugins.push(browsersync(bsConfig))
base.watch = {
chokidar: true,
include: 'src/'
}

export default base
7 changes: 7 additions & 0 deletions config/rollup.prod.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// Import base config
import base from './rollup.base'

base.output.file = base.proDest
base.output.sourcemap = process.env.BUILD_ENV === 'DEMO' || process.env.BUILD_ENV === 'CI' ? base.output.sourcemap : false

export default base
Loading

0 comments on commit 7f528b7

Please sign in to comment.