1
0
Эх сурвалжийг харах

fix: UMD bundle containing `process.env` flag (#1749)

Cue 5 жил өмнө
parent
commit
0fea8c4406
2 өөрчлөгдсөн 4 нэмэгдсэн , 6 устгасан
  1. 3 5
      jest.config.js
  2. 1 1
      src/store.js

+ 3 - 5
jest.config.js

@@ -9,11 +9,9 @@ module.exports = {
   },
   testMatch: ['<rootDir>/test/unit/**/*.spec.js'],
   testPathIgnorePatterns: ['/node_modules/'],
-  setupFilesAfterEnv: [
-    './test/setup.js'
-  ],
-  "transform": {
-    "^.+\\.js$": "<rootDir>/node_modules/babel-jest"
+  setupFilesAfterEnv: ['./test/setup.js'],
+  transform: {
+    '^.+\\.js$': '<rootDir>/node_modules/babel-jest'
   },
   coverageDirectory: 'coverage',
   coverageReporters: ['json', 'lcov', 'text-summary', 'clover'],

+ 1 - 1
src/store.js

@@ -10,7 +10,7 @@ export function createStore (options) {
 
 export class Store {
   constructor (options = {}) {
-    if (process.env.NODE_ENV !== 'production') {
+    if (__DEV__) {
       assert(typeof Promise !== 'undefined', `vuex requires a Promise polyfill in this browser.`)
       assert(this instanceof Store, `store must be called with the new operator.`)
     }