File tree Expand file tree Collapse file tree 2 files changed +21
-11
lines changed Expand file tree Collapse file tree 2 files changed +21
-11
lines changed Original file line number Diff line number Diff line change @@ -6,24 +6,34 @@ const cwd = process.cwd();
6
6
const babelRuntime = path . join ( cwd , 'node_modules' , '@babel/runtime/package.json' ) ;
7
7
let hasRuntime = existsSync ( babelRuntime ) ;
8
8
9
- const defaultConfigs = {
10
- 'cwd' : path . join ( __dirname , '../../' ) ,
11
- 'sourceMap' : false ,
12
- 'presets' : [ '@babel/preset-env' ] ,
9
+ const commonConfigs = {
13
10
'plugins' : [
14
11
[ '@babel/plugin-proposal-decorators' , { 'decoratorsBeforeExport' : true } ] ,
15
12
[ '@babel/plugin-proposal-class-properties' ] ,
16
13
] ,
17
- 'ignore' : [
18
- 'node_modules' ,
19
- 'wxa-cli' ,
20
- ] ,
21
- } ;
14
+ 'presets' : [ '@babel/preset-env' ] ,
22
15
16
+ }
23
17
if ( hasRuntime ) {
24
18
const pkg = require ( babelRuntime ) ;
25
19
26
- defaultConfigs . plugins . unshift ( [ '@babel/plugin-transform-runtime' , { 'version' : pkg . version || '7.2.0' } ] ) ;
20
+ commonConfigs . plugins . unshift ( [ '@babel/plugin-transform-runtime' , { 'version' : pkg . version || '7.2.0' } ] ) ;
27
21
}
28
22
23
+ const defaultConfigs = {
24
+ 'cwd' : path . join ( __dirname , '../../' ) ,
25
+ 'sourceMap' : false ,
26
+ overrides : [ {
27
+ exclude : [ / n o d e _ m o d u l e s / , / w x a - c l i / ] ,
28
+ ...commonConfigs
29
+ }
30
+ , {
31
+ test : / w x a - e 2 e T e s t / ,
32
+ ...commonConfigs
33
+ }
34
+
35
+ ]
36
+ } ;
37
+
38
+
29
39
export default defaultConfigs ;
Original file line number Diff line number Diff line change 1
1
export default function ( code , category = '' , path ) {
2
2
let temp = `
3
- var wrapWxa = require('wxa://wxa_wrap').default;
3
+ var wrapWxa = require('wxa://wxa_wrap.js ').default;
4
4
wrapWxa(exports, "${ category . toUpperCase ( ) } ", "${ path } ");
5
5
6
6
${ code } `;
You can’t perform that action at this time.
0 commit comments