Browse Source

meta: fix `package.json` imports to be inlined by Babel (#3047)

Using `babel-plugin-inline-package-json`.
Antoine du Hamel 3 years ago
parent
commit
a166c462ea
2 changed files with 4 additions and 5 deletions
  1. 2 3
      packages/@uppy/drag-drop/src/index.js
  2. 2 2
      packages/@uppy/webcam/src/index.js

+ 2 - 3
packages/@uppy/drag-drop/src/index.js

@@ -5,14 +5,13 @@ const isDragDropSupported = require('@uppy/utils/lib/isDragDropSupported')
 const getDroppedFiles = require('@uppy/utils/lib/getDroppedFiles')
 const { h } = require('preact')
 
-const { version } = require('../package.json')
-
 /**
  * Drag & Drop plugin
  *
  */
 module.exports = class DragDrop extends UIPlugin {
-  static VERSION = version
+  // eslint-disable-next-line global-require
+  static VERSION = require('../package.json').version
 
   constructor (uppy, opts) {
     super(uppy, opts)

+ 2 - 2
packages/@uppy/webcam/src/index.js

@@ -8,7 +8,6 @@ const supportsMediaRecorder = require('./supportsMediaRecorder')
 const CameraIcon = require('./CameraIcon')
 const CameraScreen = require('./CameraScreen')
 const PermissionsScreen = require('./PermissionsScreen')
-const packageJsonVersion = require('../package.json').version
 
 /**
  * Normalize a MIME type or file extension into a MIME type.
@@ -52,7 +51,8 @@ function getMediaDevices () {
  * Webcam
  */
 module.exports = class Webcam extends UIPlugin {
-  static VERSION = packageJsonVersion
+  // eslint-disable-next-line global-require
+  static VERSION = require('../package.json').version
 
   constructor (uppy, opts) {
     super(uppy, opts)