Merge pull request #516 from pierotofy/webpack-plugin

Updated plugin code to work with newer webpack
pull/518/head
Piero Toffanin 2018-09-06 09:52:38 -04:00 zatwierdzone przez GitHub
commit 69640b7c77
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
5 zmienionych plików z 11 dodań i 4 usunięć

Wyświetl plik

@ -39,6 +39,13 @@ export default class ApiFactory{
this.events.addListener(`${api.namespace}::${eventName}`, args => {
Promise.all(callbackOrDeps.map(dep => SystemJS.import(dep)))
.then((...deps) => {
// For each dependency, see if it exports a default module (ES6 style)
// if it does, export just the default module, otherwise export all modules
deps = deps.map(dep => {
return dep.map(exp => exp.default ? exp.default : exp);
});
const response = {
result: callbackOrUndef(...(Array.from([args]).concat(...deps))),
placeholder: args._placeholder

Wyświetl plik

@ -4,7 +4,7 @@ import './MeasurePopup.scss';
import $ from 'jquery';
import L from 'leaflet';
module.exports = class MeasurePopup extends React.Component {
export default class MeasurePopup extends React.Component {
static defaultProps = {
map: {},
model: {},

Wyświetl plik

@ -7,7 +7,7 @@ import ReactDOM from 'ReactDOM';
import React from 'react';
import $ from 'jquery';
module.exports = class App{
export default class App{
constructor(map){
this.map = map;

Wyświetl plik

@ -5,7 +5,7 @@ import Storage from 'webodm/classes/Storage';
import ErrorMessage from 'webodm/components/ErrorMessage';
import $ from 'jquery';
module.exports = class ShareButton extends React.Component{
export default class ShareButton extends React.Component{
static defaultProps = {
task: null,
token: ""

Wyświetl plik

@ -1,5 +1,5 @@
import React from 'react'; // can import React
module.exports = {
export default {
es6func: () => {} // ES6 transpiler works
};