File tree Expand file tree Collapse file tree 5 files changed +607
-53
lines changed Expand file tree Collapse file tree 5 files changed +607
-53
lines changed Original file line number Diff line number Diff line change
1
+ {
2
+ "plugins" : [
3
+ [ " @babel/plugin-transform-react-jsx" , {
4
+ "importSource" : " preact" ,
5
+ "runtime" : " automatic"
6
+ } ],
7
+ " inline-react-svg" ,
8
+ [ " module-resolver" , {
9
+ "alias" : {
10
+ "react" : " preact/compat" ,
11
+ "react-dom" : " preact/compat"
12
+ }
13
+ } ]
14
+ ]
15
+ }
Original file line number Diff line number Diff line change 2
2
3
3
const path = require ( 'path' ) ;
4
4
const {
5
- DefinePlugin,
6
- NormalModuleReplacementPlugin
5
+ DefinePlugin
7
6
} = require ( 'webpack' ) ;
8
7
9
8
const basePath = '.' ;
@@ -73,18 +72,13 @@ module.exports = function(karma) {
73
72
use : {
74
73
loader : 'babel-loader' ,
75
74
options : {
76
- plugins : [
77
- [ '@babel/plugin-transform-react-jsx' , {
78
- 'importSource' : '@bpmn-io/properties-panel/preact' ,
79
- 'runtime' : 'automatic'
80
- } ]
81
- ] . concat ( coverage ? [
75
+ plugins : coverage ? [
82
76
[ 'istanbul' , {
83
77
include : [
84
78
'lib/**'
85
79
]
86
80
} ]
87
- ] : [ ] )
81
+ ] : [ ]
88
82
}
89
83
}
90
84
} ,
@@ -99,42 +93,14 @@ module.exports = function(karma) {
99
93
100
94
// @barmac : process.env has to be defined to make @testing-library/preact work
101
95
'process.env' : { }
102
- } ) ,
103
- new NormalModuleReplacementPlugin (
104
- / ^ p r e a c t ( \/ [ ^ / ] + ) ? $ / ,
105
- function ( resource ) {
106
-
107
- const replMap = {
108
- 'preact/hooks' : path . resolve ( 'node_modules/@bpmn-io/properties-panel/preact/hooks/dist/hooks.module.js' ) ,
109
- 'preact/jsx-runtime' : path . resolve ( 'node_modules/@bpmn-io/properties-panel/preact/jsx-runtime/dist/jsxRuntime.module.js' ) ,
110
- 'preact' : path . resolve ( 'node_modules/@bpmn-io/properties-panel/preact/dist/preact.module.js' )
111
- } ;
112
-
113
- const replacement = replMap [ resource . request ] ;
114
-
115
- if ( ! replacement ) {
116
- return ;
117
- }
118
-
119
- resource . request = replacement ;
120
- }
121
- ) ,
122
- new NormalModuleReplacementPlugin (
123
- / ^ p r e a c t \/ h o o k s / ,
124
- path . resolve ( 'node_modules/@bpmn-io/properties-panel/preact/hooks/dist/hooks.module.js' )
125
- )
96
+ } )
126
97
] ,
127
98
resolve : {
128
99
mainFields : [
129
100
'browser' ,
130
101
'module' ,
131
102
'main'
132
103
] ,
133
- alias : {
134
- 'preact' : '@bpmn-io/properties-panel/preact' ,
135
- 'react' : '@bpmn-io/properties-panel/preact/compat' ,
136
- 'react-dom' : '@bpmn-io/properties-panel/preact/compat'
137
- } ,
138
104
modules : [
139
105
'node_modules' ,
140
106
absoluteBasePath
You can’t perform that action at this time.
0 commit comments