-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(dependencies): upgrade all dependencies
- Loading branch information
Dimitri Kopriwa
committed
Jun 17, 2019
1 parent
1866c99
commit 3ca3600
Showing
4 changed files
with
47 additions
and
127 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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
const { createConfig } = require('@rollup-umd/ncu'); | ||
module.exports = createConfig(); |
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 |
---|---|---|
|
@@ -21,3 +21,4 @@ coverage/ | |
docs/ | ||
reports/ | ||
/styleguide | ||
.ncurc.js |
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 |
---|---|---|
@@ -1,80 +1,2 @@ | ||
/* eslint-disable flowtype-errors/show-errors, no-console, import/extensions */ | ||
import nodeResolve from 'rollup-plugin-node-resolve'; | ||
import replace from 'rollup-plugin-replace'; | ||
import commonjs from 'rollup-plugin-commonjs'; | ||
import inject from 'rollup-plugin-inject'; | ||
import babel from 'rollup-plugin-babel'; | ||
import json from 'rollup-plugin-json'; | ||
import { terser } from 'rollup-plugin-terser'; | ||
import cleanup from 'rollup-plugin-cleanup'; | ||
import visualizer from 'rollup-plugin-visualizer'; | ||
import pkg from './package.json'; | ||
import declination from './declination.json'; | ||
const processShim = '\0process-shim'; | ||
const prod = process.env.PRODUCTION; | ||
const mode = prod ? 'production' : 'development'; | ||
const { external, globals } = declination; | ||
|
||
console.log(`Creating ${mode} bundle...`); | ||
|
||
const output = prod ? [ | ||
{ | ||
name: pkg.name, exports: 'named', globals, file: `dist/${pkg.name}.min.js`, format: 'umd', sourcemap: true, | ||
}, | ||
{ | ||
name: pkg.name, exports: 'named', globals, file: `dist/${pkg.name}.cjs.min.js`, format: 'cjs', sourcemap: true, | ||
}, | ||
{ | ||
name: pkg.name, exports: 'named', globals, file: `dist/${pkg.name}.esm.js`, format: 'es', sourcemap: true, | ||
}, | ||
] : [ | ||
{ | ||
name: pkg.name, exports: 'named', globals, file: `dist/${pkg.name}.js`, format: 'umd', sourcemap: true, | ||
}, | ||
{ | ||
name: pkg.name, exports: 'named', globals, file: `dist/${pkg.name}.cjs.js`, format: 'cjs', sourcemap: true, | ||
}, | ||
{ | ||
name: pkg.name, exports: 'named', globals, file: `dist/${pkg.name}.esm.js`, format: 'es', sourcemap: true, | ||
}, | ||
]; | ||
const plugins = [ | ||
// Unlike Webpack and Browserify, Rollup doesn't automatically shim Node | ||
// builtins like `process`. This ad-hoc plugin creates a 'virtual module' | ||
// which includes a shim containing just the parts the bundle needs. | ||
{ | ||
resolveId(importee) { | ||
if (importee === processShim) return importee; | ||
return null; | ||
}, | ||
load(id) { | ||
if (id === processShim) return 'export default { argv: [], env: {} }'; | ||
return null; | ||
}, | ||
}, | ||
nodeResolve({ | ||
browser: true, | ||
}), | ||
commonjs({ | ||
include: 'node_modules/**', | ||
}), | ||
replace({ | ||
'process.env.NODE_ENV': JSON.stringify(prod ? 'production' : 'development'), | ||
}), | ||
inject({ | ||
process: processShim, | ||
}), | ||
babel({ | ||
babelrc: false, | ||
exclude: 'node_modules/**', | ||
}), | ||
json(), | ||
cleanup(), | ||
]; | ||
|
||
export default output.map((o) => ({ | ||
input: 'src/index.js', | ||
external, | ||
output: o, | ||
plugins: prod ? plugins.concat([terser(), visualizer({ filename: './bundle-stats.html' })]) : plugins, | ||
})); | ||
const { createConfig } = require('@rollup-umd/rollup'); | ||
module.exports = createConfig(); |