Skip to content

Commit

Permalink
🔧 update config to match upgraded deps
Browse files Browse the repository at this point in the history
  • Loading branch information
lowmess committed May 26, 2020
1 parent c59050e commit 7dfa743
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .babelrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"presets": [
["env", {
["@babel/preset-env", {
"modules": false
}]
]
Expand Down
17 changes: 14 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,21 @@
"rollup": "^2.10.9",
"rollup-plugin-babel-minify": "^10.0.0"
},
"browserlist": [
"last 2 versions",
"> 5%"
"browserslist": [
"> 0.25%",
"last 2 chrome versions",
"last 2 edge versions",
"last 2 firefox versions",
"last 2 safari versions",
"not dead",
"not ie <= 11",
"not op_mini all"
],
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"*.js": [
"eslint --fix",
Expand Down
28 changes: 18 additions & 10 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,32 @@
import path from 'path'
import babel from 'rollup-plugin-babel'
import babel from '@rollup/plugin-babel'
import minify from 'rollup-plugin-babel-minify'

const pkg = require(path.resolve(process.cwd(), './package.json'))

const plugs = [babel()]
const plugins = [babel()]

if (process.env.NODE_ENV === 'production') {
plugs.push(
plugins.push(
minify({
comments: false,
})
)
}

const config = {
entry: './src/hero-patterns.js',
sourceMap: true,
plugins: plugs,
targets: [{ dest: pkg.main, format: 'cjs' }, { dest: pkg.module, format: 'es' }],
export default {
input: './src/hero-patterns.js',
plugins,
output: [
{
file: pkg.main,
format: 'cjs',
sourcemap: true,
},
{
file: pkg.module,
format: 'es',
sourcemap: true,
},
],
}

export default config

0 comments on commit 7dfa743

Please sign in to comment.