Skip to content

Commit

Permalink
Upgrade all deps. Makes audit happy
Browse files Browse the repository at this point in the history
  • Loading branch information
ApacheEx committed Mar 3, 2021
1 parent 3e4351f commit c4a0154
Show file tree
Hide file tree
Showing 4 changed files with 1,247 additions and 1,204 deletions.
9 changes: 1 addition & 8 deletions .babelrc.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
const presets = [
[
"@babel/env",
{
"useBuiltIns": "entry"
},
],
];
const presets = [['@babel/env']];

module.exports = { presets };
21 changes: 12 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,18 @@
"styled-components": ">= 1"
},
"devDependencies": {
"@babel/core": "^7.1.6",
"@babel/preset-env": "^7.1.6",
"rimraf": "^2.6.2",
"rollup": "^0.67.3",
"rollup-plugin-babel": "^4.0.3",
"rollup-plugin-commonjs": "^9.2.0",
"rollup-plugin-node-resolve": "^3.4.0",
"rollup-plugin-uglify": "^6.0.0",
"styled-components": "^4.1.1"
"@babel/core": "^7.13.8",
"@babel/preset-env": "^7.13.9",
"@rollup/plugin-babel": "^5.3.0",
"@rollup/plugin-commonjs": "^17.1.0",
"@rollup/plugin-node-resolve": "^11.2.0",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-is": "^17.0.1",
"rimraf": "^3.0.2",
"rollup": "^2.40.0",
"rollup-plugin-terser": "^7.0.2",
"styled-components": "^5.2.1"
},
"browserslist": "> 0.25%, not dead"
}
40 changes: 13 additions & 27 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,32 +1,28 @@
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';
import resolve from '@rollup/plugin-node-resolve';
import babel from '@rollup/plugin-babel';
import commonjs from '@rollup/plugin-commonjs';
import { terser } from 'rollup-plugin-terser';

const prod = process.env.PRODUCTION;

let config = {
input: 'src/index.js',
output: {
sourcemap: true,
exports: 'named'
exports: 'named',
},
external: ['react', 'styled-components'],
};

let plugins = [
resolve(),
commonjs(),
babel(),
];
let plugins = [resolve(), commonjs(), babel({ babelHelpers: 'bundled' })];

const globals = {
'styled-components': 'styledComponents',
react: 'React',
'react-dom': 'ReactDOM',
};

if (prod) plugins.push(uglify());
if (prod) plugins.push(terser());

if (process.env.BROWSER) {
config = Object.assign(config, {
Expand All @@ -39,34 +35,24 @@ if (process.env.BROWSER) {
globals,
},
plugins,
})

});
} else if (process.env.COMMON) {
config = Object.assign(config, {
plugins: [
resolve(),
commonjs(),
babel(),
],
plugins,
output: {
file: 'dist/styled-media-query.common.js',
format: 'cjs',
exports: 'named',
}
})

},
});
} else if (process.env.ES) {
config = Object.assign(config, {
plugins: [
resolve(),
commonjs(),
babel(),
],
plugins,
output: {
file: 'dist/styled-media-query.es.js',
format: 'es',
},
})
});
}

export default config;
Loading

0 comments on commit c4a0154

Please sign in to comment.