Skip to content

Commit 4fc2513

Browse files
committed
fix babel polyfill for thirdparties transcranial#109
1 parent df99915 commit 4fc2513

File tree

4 files changed

+39
-33
lines changed

4 files changed

+39
-33
lines changed

demos/src/demos.js

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import Vue from 'vue'
2+
import Vuetify from 'vuetify'
3+
import App from './App'
4+
import router from './router'
5+
import 'vuetify/dist/vuetify.min.css'
6+
7+
Vue.use(Vuetify, {
8+
theme: {
9+
primary: '#1bbc9b',
10+
secondary: '#69707a',
11+
accent: '#f5d76e',
12+
error: '#d24d57'
13+
}
14+
})
15+
16+
const app = new Vue(Object.assign({ router }, App))
17+
18+
app.$mount('#root')

demos/src/index.js

+4-19
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,4 @@
1-
import '@babel/polyfill'
2-
import Vue from 'vue'
3-
import Vuetify from 'vuetify'
4-
import App from './App'
5-
import router from './router'
6-
import 'vuetify/dist/vuetify.min.css'
7-
8-
Vue.use(Vuetify, {
9-
theme: {
10-
primary: '#1bbc9b',
11-
secondary: '#69707a',
12-
accent: '#f5d76e',
13-
error: '#d24d57'
14-
}
15-
})
16-
17-
const app = new Vue(Object.assign({ router }, App))
18-
19-
app.$mount('#root')
1+
if (!global._babelPolyfill) {
2+
require('@babel/polyfill')
3+
}
4+
import './demos'

src/index.js

+4-14
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,4 @@
1-
import '@babel/polyfill'
2-
import Model from './Model'
3-
import Tensor from './Tensor'
4-
import { webgl2 } from './WebGL2'
5-
import * as activations from './activations'
6-
import * as layers from './layers'
7-
import * as testUtils from './utils/testUtils'
8-
9-
const GPU_SUPPORT = webgl2.isSupported
10-
11-
export { Model, Tensor, GPU_SUPPORT, activations, layers, testUtils }
12-
13-
const KerasJS = { Model, Tensor, GPU_SUPPORT, activations, layers, testUtils }
14-
export { KerasJS as default }
1+
if (!global._babelPolyfill) {
2+
require('@babel/polyfill')
3+
}
4+
import './keras'

src/keras.js

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import Model from './Model'
2+
import Tensor from './Tensor'
3+
import { webgl2 } from './WebGL2'
4+
import * as activations from './activations'
5+
import * as layers from './layers'
6+
import * as testUtils from './utils/testUtils'
7+
8+
const GPU_SUPPORT = webgl2.isSupported
9+
10+
export { Model, Tensor, GPU_SUPPORT, activations, layers, testUtils }
11+
12+
const KerasJS = { Model, Tensor, GPU_SUPPORT, activations, layers, testUtils }
13+
export { KerasJS as default }

0 commit comments

Comments
 (0)