mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
replace require.context babel plugin
This commit is contained in:
parent
77f4810ddc
commit
4347bdd1ed
@ -1,7 +1,6 @@
|
|||||||
{
|
{
|
||||||
"plugins": [
|
"plugins": [
|
||||||
"@babel/plugin-syntax-dynamic-import",
|
"@babel/plugin-syntax-dynamic-import"
|
||||||
"transform-require-context"
|
|
||||||
],
|
],
|
||||||
"presets": [
|
"presets": [
|
||||||
[
|
[
|
||||||
@ -13,6 +12,7 @@
|
|||||||
],
|
],
|
||||||
"env": {
|
"env": {
|
||||||
"test": {
|
"test": {
|
||||||
|
"plugins": ["require-context-hook"],
|
||||||
"presets": [
|
"presets": [
|
||||||
[
|
[
|
||||||
"@babel/preset-env",
|
"@babel/preset-env",
|
||||||
|
|||||||
@ -48,6 +48,7 @@
|
|||||||
"\\.(css|less)$": "identity-obj-proxy"
|
"\\.(css|less)$": "identity-obj-proxy"
|
||||||
},
|
},
|
||||||
"setupFiles": [
|
"setupFiles": [
|
||||||
|
"<rootDir>/registerContext.js",
|
||||||
"<rootDir>/testSetup.js"
|
"<rootDir>/testSetup.js"
|
||||||
],
|
],
|
||||||
"testMatch": [
|
"testMatch": [
|
||||||
@ -65,7 +66,6 @@
|
|||||||
"accounting": "~0.4.1",
|
"accounting": "~0.4.1",
|
||||||
"apollo-cache-inmemory": "~1.6.3",
|
"apollo-cache-inmemory": "~1.6.3",
|
||||||
"apollo-client": "~2.6.4",
|
"apollo-client": "~2.6.4",
|
||||||
"babel-plugin-transform-require-context": "^0.1.1",
|
|
||||||
"cookie-universal-nuxt": "~2.0.18",
|
"cookie-universal-nuxt": "~2.0.18",
|
||||||
"cropperjs": "^1.5.5",
|
"cropperjs": "^1.5.5",
|
||||||
"cross-env": "~6.0.3",
|
"cross-env": "~6.0.3",
|
||||||
@ -112,6 +112,7 @@
|
|||||||
"babel-eslint": "~10.0.3",
|
"babel-eslint": "~10.0.3",
|
||||||
"babel-jest": "~24.9.0",
|
"babel-jest": "~24.9.0",
|
||||||
"babel-loader": "~8.0.6",
|
"babel-loader": "~8.0.6",
|
||||||
|
"babel-plugin-require-context-hook": "^1.0.0",
|
||||||
"babel-preset-vue": "~2.0.2",
|
"babel-preset-vue": "~2.0.2",
|
||||||
"core-js": "~2.6.10",
|
"core-js": "~2.6.10",
|
||||||
"css-loader": "~3.2.0",
|
"css-loader": "~3.2.0",
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
|
|
||||||
const componentFiles = require.context('~/components/_new/generic', true, /Base[a-zA-Z]+\.vue/)
|
const componentFiles = require.context('../components/_new/generic', true, /Base[a-zA-Z]+\.vue/)
|
||||||
|
|
||||||
componentFiles.keys().forEach(fileName => {
|
componentFiles.keys().forEach(fileName => {
|
||||||
const component = componentFiles(fileName)
|
const component = componentFiles(fileName)
|
||||||
|
|||||||
2
webapp/registerContext.js
Normal file
2
webapp/registerContext.js
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
import registerRequireContextHook from 'babel-plugin-require-context-hook/register'
|
||||||
|
registerRequireContextHook()
|
||||||
@ -1,3 +1,6 @@
|
|||||||
|
// import fs from 'fs'
|
||||||
|
// import path from 'path'
|
||||||
|
|
||||||
import { createLocalVue } from '@vue/test-utils'
|
import { createLocalVue } from '@vue/test-utils'
|
||||||
import Vuex from 'vuex'
|
import Vuex from 'vuex'
|
||||||
import VTooltip from 'v-tooltip'
|
import VTooltip from 'v-tooltip'
|
||||||
@ -14,3 +17,14 @@ global.localVue.use(Styleguide)
|
|||||||
global.localVue.use(BaseComponents)
|
global.localVue.use(BaseComponents)
|
||||||
global.localVue.use(Filters)
|
global.localVue.use(Filters)
|
||||||
global.localVue.use(InfiniteScroll)
|
global.localVue.use(InfiniteScroll)
|
||||||
|
|
||||||
|
// // import BaseComponents without require.context for tests
|
||||||
|
// const componentFiles = fs
|
||||||
|
// .readdirSync(path.join(__dirname, 'components/_new/generic/'))
|
||||||
|
// .filter(fileName => /Base[a-zA-Z]+\.vue/.test(fileName))
|
||||||
|
|
||||||
|
// componentFiles.forEach(fileName => {
|
||||||
|
// const componentName = fileName.replace(/^.+\//, '').replace('.vue', '')
|
||||||
|
// const componentConfig = require('~/components/_new/generic/' + fileName)
|
||||||
|
// global.localVue.component(componentName, componentConfig.default || componentConfig)
|
||||||
|
// })
|
||||||
|
|||||||
@ -867,7 +867,7 @@
|
|||||||
dependencies:
|
dependencies:
|
||||||
regenerator-runtime "^0.13.2"
|
regenerator-runtime "^0.13.2"
|
||||||
|
|
||||||
"@babel/template@7", "@babel/template@^7.1.0", "@babel/template@^7.4.0", "@babel/template@^7.4.4", "@babel/template@^7.7.0":
|
"@babel/template@^7.1.0", "@babel/template@^7.4.0", "@babel/template@^7.4.4", "@babel/template@^7.7.0":
|
||||||
version "7.7.0"
|
version "7.7.0"
|
||||||
resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.7.0.tgz#4fadc1b8e734d97f56de39c77de76f2562e597d0"
|
resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.7.0.tgz#4fadc1b8e734d97f56de39c77de76f2562e597d0"
|
||||||
integrity sha512-OKcwSYOW1mhWbnTBgQY5lvg1Fxg+VyfQGjcBduZFljfc044J5iDlnDSfhQ867O17XHiSCxYHUxHg2b7ryitbUQ==
|
integrity sha512-OKcwSYOW1mhWbnTBgQY5lvg1Fxg+VyfQGjcBduZFljfc044J5iDlnDSfhQ867O17XHiSCxYHUxHg2b7ryitbUQ==
|
||||||
@ -4498,6 +4498,11 @@ babel-plugin-minify-type-constructors@^0.4.3:
|
|||||||
dependencies:
|
dependencies:
|
||||||
babel-helper-is-void-0 "^0.4.3"
|
babel-helper-is-void-0 "^0.4.3"
|
||||||
|
|
||||||
|
babel-plugin-require-context-hook@^1.0.0:
|
||||||
|
version "1.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/babel-plugin-require-context-hook/-/babel-plugin-require-context-hook-1.0.0.tgz#3f0e7cce87c338f53639b948632fd4e73834632d"
|
||||||
|
integrity sha512-EMZD1563QUqLhzrqcThk759RhuNVX/ZJdrtGK6drwzgvnR+ARjWyXIHPbu+tUNaMGtPz/gQeAM2M6VUw2UiUeA==
|
||||||
|
|
||||||
babel-plugin-syntax-jsx@^6.18.0:
|
babel-plugin-syntax-jsx@^6.18.0:
|
||||||
version "6.18.0"
|
version "6.18.0"
|
||||||
resolved "https://registry.yarnpkg.com/babel-plugin-syntax-jsx/-/babel-plugin-syntax-jsx-6.18.0.tgz#0af32a9a6e13ca7a3fd5069e62d7b0f58d0d8946"
|
resolved "https://registry.yarnpkg.com/babel-plugin-syntax-jsx/-/babel-plugin-syntax-jsx-6.18.0.tgz#0af32a9a6e13ca7a3fd5069e62d7b0f58d0d8946"
|
||||||
@ -4562,13 +4567,6 @@ babel-plugin-transform-remove-undefined@^0.5.0:
|
|||||||
dependencies:
|
dependencies:
|
||||||
babel-helper-evaluate-path "^0.5.0"
|
babel-helper-evaluate-path "^0.5.0"
|
||||||
|
|
||||||
babel-plugin-transform-require-context@^0.1.1:
|
|
||||||
version "0.1.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/babel-plugin-transform-require-context/-/babel-plugin-transform-require-context-0.1.1.tgz#319b545ca83080b5062776b46cc9b8b346fea9a6"
|
|
||||||
integrity sha512-4ceqYOtzgmq4/QsB8dP7pUrUOCjY/jrRYdt7YkIOWHxtGDQbcf6YZDyLCiPQf6KsEIcIbSQiTRXOsbLiuJfgNQ==
|
|
||||||
dependencies:
|
|
||||||
"@babel/template" "7"
|
|
||||||
|
|
||||||
babel-plugin-transform-simplify-comparison-operators@^6.9.4:
|
babel-plugin-transform-simplify-comparison-operators@^6.9.4:
|
||||||
version "6.9.4"
|
version "6.9.4"
|
||||||
resolved "https://registry.yarnpkg.com/babel-plugin-transform-simplify-comparison-operators/-/babel-plugin-transform-simplify-comparison-operators-6.9.4.tgz#f62afe096cab0e1f68a2d753fdf283888471ceb9"
|
resolved "https://registry.yarnpkg.com/babel-plugin-transform-simplify-comparison-operators/-/babel-plugin-transform-simplify-comparison-operators-6.9.4.tgz#f62afe096cab0e1f68a2d753fdf283888471ceb9"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user