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 22
33const path = require ( 'path' ) ;
44const {
5- DefinePlugin,
6- NormalModuleReplacementPlugin
5+ DefinePlugin
76} = require ( 'webpack' ) ;
87
98const basePath = '.' ;
@@ -73,18 +72,13 @@ module.exports = function(karma) {
7372 use : {
7473 loader : 'babel-loader' ,
7574 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 ? [
8276 [ 'istanbul' , {
8377 include : [
8478 'lib/**'
8579 ]
8680 } ]
87- ] : [ ] )
81+ ] : [ ]
8882 }
8983 }
9084 } ,
@@ -99,42 +93,14 @@ module.exports = function(karma) {
9993
10094 // @barmac : process.env has to be defined to make @testing-library/preact work
10195 '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+ } )
12697 ] ,
12798 resolve : {
12899 mainFields : [
129100 'browser' ,
130101 'module' ,
131102 'main'
132103 ] ,
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- } ,
138104 modules : [
139105 'node_modules' ,
140106 absoluteBasePath
You can’t perform that action at this time.
0 commit comments