Skip to content

Commit 0e5a62b

Browse files
authored
Fix UMD build (#309)
1 parent 62af442 commit 0e5a62b

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
"rollup-plugin-babel": "^3.0.2",
5858
"rollup-plugin-commonjs": "^8.1.0",
5959
"rollup-plugin-node-resolve": "^3.0.0",
60+
"rollup-plugin-replace": "^2.0.0",
6061
"rollup-plugin-uglify": "^2.0.1",
6162
"sinon": "^1.17.6",
6263
"webpack": "^3.5.5",

rollup.config.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import nodeResolve from 'rollup-plugin-node-resolve';
22
import babel from 'rollup-plugin-babel';
33
import commonjs from 'rollup-plugin-commonjs';
44
import uglify from 'rollup-plugin-uglify';
5+
import replace from 'rollup-plugin-replace';
56

67
const env = process.env.NODE_ENV;
78

@@ -24,6 +25,8 @@ const config = {
2425
],
2526
};
2627

28+
29+
2730
if (env === 'production') {
2831
config.plugins.push(
2932
uglify({
@@ -35,6 +38,12 @@ if (env === 'production') {
3538
},
3639
})
3740
);
41+
42+
config.plugins.push(
43+
replace({
44+
'process.env.NODE_ENV': JSON.stringify( 'production' )
45+
})
46+
)
3847
}
3948

4049
export default config;

yarn.lock

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4825,6 +4825,12 @@ magic-string@^0.19.0:
48254825
dependencies:
48264826
vlq "^0.2.1"
48274827

4828+
magic-string@^0.22.4:
4829+
version "0.22.5"
4830+
resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.22.5.tgz#8e9cf5afddf44385c1da5bc2a6a0dbd10b03657e"
4831+
dependencies:
4832+
vlq "^0.2.2"
4833+
48284834
make-dir@^1.0.0:
48294835
version "1.0.0"
48304836
resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-1.0.0.tgz#97a011751e91dd87cfadef58832ebb04936de978"
@@ -6559,6 +6565,14 @@ rollup-plugin-node-resolve@^3.0.0:
65596565
is-module "^1.0.0"
65606566
resolve "^1.1.6"
65616567

6568+
rollup-plugin-replace@^2.0.0:
6569+
version "2.0.0"
6570+
resolved "https://registry.yarnpkg.com/rollup-plugin-replace/-/rollup-plugin-replace-2.0.0.tgz#19074089c8ed57184b8cc64e967a03d095119277"
6571+
dependencies:
6572+
magic-string "^0.22.4"
6573+
minimatch "^3.0.2"
6574+
rollup-pluginutils "^2.0.1"
6575+
65626576
rollup-plugin-uglify@^2.0.1:
65636577
version "2.0.1"
65646578
resolved "https://registry.yarnpkg.com/rollup-plugin-uglify/-/rollup-plugin-uglify-2.0.1.tgz#67b37ad1efdafbd83af4c36b40c189ee4866c969"
@@ -7507,6 +7521,10 @@ vlq@^0.2.1:
75077521
version "0.2.2"
75087522
resolved "https://registry.yarnpkg.com/vlq/-/vlq-0.2.2.tgz#e316d5257b40b86bb43cb8d5fea5d7f54d6b0ca1"
75097523

7524+
vlq@^0.2.2:
7525+
version "0.2.3"
7526+
resolved "https://registry.yarnpkg.com/vlq/-/vlq-0.2.3.tgz#8f3e4328cf63b1540c0d67e1b2778386f8975b26"
7527+
75107528
75117529
version "0.0.4"
75127530
resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-0.0.4.tgz#5d7ea45bbef9e4a6ff65f95438e0a87c357d5a73"

0 commit comments

Comments
 (0)