remaxjs / remax
1 3
import * as path from 'path';
2 3
import hostComponents from '../hostComponents/node';
3
import { PluginConstructor } from '@remax/types';
4

5 3
const EJS_TPL_ROOT = path.join(__dirname, '../../templates');
6

7 3
const plugin: PluginConstructor = () => {
8 3
  return {
9
    meta: {
10
      global: 'wx',
11
      template: {
12
        extension: '.wxml',
13
        tag: 'import',
14
        src: 'src',
15
      },
16
      style: '.wxss',
17
      jsHelper: {
18
        extension: '.wxs',
19
        tag: 'wxs',
20
        src: 'src',
21
      },
22
      ejs: {
23
        base: path.join(EJS_TPL_ROOT, 'base.ejs'),
24
        page: path.join(EJS_TPL_ROOT, 'page.ejs'),
25
      },
26
    },
27
    hostComponents,
28 3
    shouldHostComponentRegister: ({ componentName }) => componentName !== 'swiper-item',
29
  };
30
};
31

32 3
export default plugin;

Read our documentation on viewing source code .

Loading