From 70bdf19220cad8ccbaa61c67e43fda9a88333834 Mon Sep 17 00:00:00 2001 From: Tetsuharu OHZEKI Date: Mon, 5 Sep 2016 00:44:21 +0900 Subject: [PATCH] build(rollup): inject node's global objects --- package.json | 1 + rollup.config.js | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/package.json b/package.json index 4ffe3584..a74d7fb6 100644 --- a/package.json +++ b/package.json @@ -100,6 +100,7 @@ "rollup": "^0.34.13", "rollup-plugin-babel": "^2.6.1", "rollup-plugin-commonjs": "^4.1.0", + "rollup-plugin-node-globals": "^1.0.6", "rollup-plugin-node-resolve": "^2.0.0", "stylelint": "^7.2.0", "tslint": "3.15.0-dev.0", diff --git a/rollup.config.js b/rollup.config.js index e4fbc539..9af377f0 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -7,6 +7,7 @@ const path = require('path'); const nodeResolve = require('rollup-plugin-node-resolve'); const commonjs = require('rollup-plugin-commonjs'); const babel = require('rollup-plugin-babel'); +const nodeGlobals = require('rollup-plugin-node-globals'); const isRelease = process.env.NODE_ENV === 'production'; @@ -101,5 +102,8 @@ module.exports = { presets: babelPresets, plugins: babelPlugins, }), + + // https://github.com/calvinmetcalf/rollup-plugin-node-builtins + nodeGlobals(), ] };