1 | const compileTemplate = require('../src/index.js');
|
2 | const source = `<view class="demo-com" >
|
3 |
|
4 | </view>`
|
5 |
|
6 |
|
7 |
|
8 |
|
9 | let options = {lang: 'cml',
|
10 | filePath: '/Users/didi/components.cml',
|
11 | buildInComponents: {button: "cml-buildin-button"},
|
12 | isInjectBaseStyle: false,
|
13 | cmss: {
|
14 | rem: true,
|
15 | scale: 0.5,
|
16 | remOptions: {
|
17 |
|
18 | rootValue: 75,
|
19 |
|
20 | minPixelValue: 1.01
|
21 | },
|
22 | autoprefixOptions: {
|
23 | browsers: ['> 0.1%', 'ios >= 8', 'not ie < 12']
|
24 | }
|
25 | },
|
26 | usingComponents: [{
|
27 | tagName: 'cube-button',
|
28 | refUrl: '/path/to/ref1',
|
29 | filePath: 'path/to/real1',
|
30 | isNative: true
|
31 | }, {
|
32 | tagName: 'thirdComp2',
|
33 | refUrl: '/path/to/ref2',
|
34 | filePath: 'path/to/real2',
|
35 | isNative: false
|
36 | }]
|
37 | };
|
38 | console.log('before-compile', source);
|
39 | let result_web = compileTemplate(source, 'web', options);
|
40 | let result_weex = compileTemplate(source, 'weex', options);
|
41 |
|
42 |
|
43 |
|
44 |
|
45 | console.log('result_weex', result_weex)
|
46 |
|
47 |
|
48 |
|