Skip to content

Commit

Permalink
[update] switch preset-env => @babel/preset-env (#244)
Browse files Browse the repository at this point in the history
* [update] switch preset-env => @babel/preset-env

* [updates] .eslintrc update
  • Loading branch information
yowainwright authored Feb 25, 2018
1 parent 2e0f495 commit 0e9f815
Show file tree
Hide file tree
Showing 18 changed files with 515 additions and 107 deletions.
5 changes: 3 additions & 2 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
{
"presets": [
["env", {
["@babel/preset-env", {
"loose": true,
"targets": {
"browsers": [
"defaults",
"ie >= 9"
]
}
}]
]
],
}
2 changes: 0 additions & 2 deletions .browserslistrc

This file was deleted.

2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": [ "standard"],
"extends": "dollarshaveclub",
"env": {
"browser": true,
"node": true
Expand Down
14 changes: 8 additions & 6 deletions configs/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ import {
homepage,
license,
name,
version
version,
} from '../package.json'

const loose = true

const babelSetup = {
babelrc: false,
presets: [['env', { modules: false }]],
exclude: 'node_modules/**'
presets: [['@babel/preset-env', { modules: false, loose }]],
exclude: 'node_modules/**',
}

const uglifyOutput = {
Expand All @@ -22,8 +24,8 @@ const uglifyOutput = {
// multiline comment
return /@preserve|@license|@cc_on/i.test(text)
}
}
}
},
},
}

const banner = `/**
Expand All @@ -39,5 +41,5 @@ export {
banner,
name,
uglifyOutput,
version
version,
}
10 changes: 3 additions & 7 deletions configs/rollup.config.es.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,22 @@ import {
babelSetup,
banner,
name,
uglifyOutput,
version
version,
} from '../configs/config'
import babel from 'rollup-plugin-babel'
import replace from 'rollup-plugin-replace'
import uglify from 'rollup-plugin-uglify'

export default {
input: 'src/stickybits.js',
plugins: [
babel(babelSetup),
replace({ VERSION: JSON.stringify(version) }),
uglify(uglifyOutput)
],
treeshake: false,
output: {
banner,
file: 'dist/stickybits.es.js',
format: 'es',
name,
sourcemap: false
}
sourcemap: false,
},
}
8 changes: 4 additions & 4 deletions configs/rollup.config.jquery-dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
babelSetup,
banner,
name,
version
version,
} from '../configs/config'
import babel from 'rollup-plugin-babel'
import replace from 'rollup-plugin-replace'
Expand All @@ -11,14 +11,14 @@ export default {
input: 'src/jquery.stickybits.js',
plugins: [
babel(babelSetup),
replace({ VERSION: JSON.stringify(version) })
replace({ VERSION: JSON.stringify(version) }),
],
treeshake: false,
output: {
banner,
file: 'dist/jquery.stickybits.js',
format: 'umd',
name,
sourcemap: false
}
sourcemap: false,
},
}
8 changes: 4 additions & 4 deletions configs/rollup.config.jquery.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
banner,
name,
uglifyOutput,
version
version,
} from '../configs/config'
import babel from 'rollup-plugin-babel'
import replace from 'rollup-plugin-replace'
Expand All @@ -14,14 +14,14 @@ export default {
plugins: [
babel(babelSetup),
replace({ VERSION: JSON.stringify(version) }),
uglify(uglifyOutput)
uglify(uglifyOutput),
],
treeshake: false,
output: {
banner,
file: 'dist/jquery.stickybits.min.js',
format: 'umd',
name,
sourcemap: false
}
sourcemap: false,
},
}
8 changes: 4 additions & 4 deletions configs/rollup.config.standard-dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
babelSetup,
banner,
name,
version
version,
} from '../configs/config'
import babel from 'rollup-plugin-babel'
import replace from 'rollup-plugin-replace'
Expand All @@ -11,14 +11,14 @@ export default {
input: 'src/stickybits.js',
plugins: [
babel(babelSetup),
replace({ VERSION: JSON.stringify(version) })
replace({ VERSION: JSON.stringify(version) }),
],
treeshake: false,
output: {
banner,
file: 'dist/stickybits.js',
format: 'umd',
name,
sourcemap: false
}
sourcemap: false,
},
}
8 changes: 4 additions & 4 deletions configs/rollup.config.standard.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
banner,
name,
uglifyOutput,
version
version,
} from '../configs/config'
import babel from 'rollup-plugin-babel'
import replace from 'rollup-plugin-replace'
Expand All @@ -14,14 +14,14 @@ export default {
plugins: [
babel(babelSetup),
replace({ VERSION: JSON.stringify(version) }),
uglify(uglifyOutput)
uglify(uglifyOutput),
],
treeshake: false,
output: {
banner,
file: 'dist/stickybits.min.js',
format: 'umd',
name,
sourcemap: false
}
sourcemap: false,
},
}
8 changes: 4 additions & 4 deletions configs/rollup.config.umbrella.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
banner,
name,
uglifyOutput,
version
version,
} from '../configs/config'
import babel from 'rollup-plugin-babel'
import replace from 'rollup-plugin-replace'
Expand All @@ -14,14 +14,14 @@ export default {
plugins: [
babel(babelSetup),
replace({ VERSION: JSON.stringify(version) }),
uglify(uglifyOutput)
uglify(uglifyOutput),
],
treeshake: false,
output: {
banner,
file: 'dist/umbrella.stickybits.js',
format: 'umd',
name,
sourcemap: false
}
sourcemap: false,
},
}
Loading

0 comments on commit 0e9f815

Please sign in to comment.