From e504aaafd1325f536c806335a4d61934332d4bb8 Mon Sep 17 00:00:00 2001 From: toxic-johann <353904974@qq.com> Date: Tue, 8 Aug 2017 21:00:08 +0800 Subject: [PATCH] [update] fix bug on dev and umd what: why: how: --- build/rollup.config.dev.js | 4 ++++ build/rollup.config.umd.js | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/build/rollup.config.dev.js b/build/rollup.config.dev.js index ea3ad842..67162ffb 100644 --- a/build/rollup.config.dev.js +++ b/build/rollup.config.dev.js @@ -1,6 +1,7 @@ import base from './rollup.config.base'; import serve from 'rollup-plugin-serve'; import livereload from 'rollup-plugin-livereload'; +import replace from 'rollup-plugin-replace'; import {camelize} from 'toxic-utils'; const {name} = require('../package.json'); const config = base('iife'); @@ -8,6 +9,9 @@ config.plugins.push( serve(), livereload() ); +config.plugins.unshift(replace({ + 'process.env.NODE_ENV': '"development"' +})); export default Object.assign(config, { format: 'umd', dest: 'lib/index.dev.js', diff --git a/build/rollup.config.umd.js b/build/rollup.config.umd.js index 9ffb9235..7c6339f9 100644 --- a/build/rollup.config.umd.js +++ b/build/rollup.config.umd.js @@ -1,7 +1,12 @@ import base from './rollup.config.base'; const {name} = require('../package.json'); import {camelize} from 'toxic-utils'; -export default Object.assign(base('umd'), { +import replace from 'rollup-plugin-replace'; +const config = base('umd'); +config.plugins.unshift(replace({ + 'process.env.NODE_ENV': '"development"' +})); +export default Object.assign(config, { format: 'umd', dest: 'lib/index.browser.js', moduleName: camelize(name, true)