npm.io
1.0.3 • Published 11h ago

@beautiful-eyes/template-compiler

Licence
ISC
Version
1.0.3
Deps
1
Size
144 kB
Vulns
0
Weekly
0

@beautiful-eyes/template-compiler

Webpack loader that compiles Beautiful Eyes .template.be files into a JS module: lexer → parser → AST → stringify visitor.

The emitted array is what View in @beautiful-eyes/core walks at runtime. The browser never sees the source text.

npm install @beautiful-eyes/template-compiler
// webpack.config.js
module.exports = {
  module: {
    rules: [
      {
        test: /\.template\.be$/,
        use: ['@beautiful-eyes/template-compiler/dist/index.js']
      }
    ]
  }
};
import template from './counter.template.be';
// template is [{ type: 0, name: 'button', children: [ function(){ return this.count } ], ... }]

Rebuild this package (npm run build -w @beautiful-eyes/template-compiler) after lexer or parser changes. The loader entry is dist/index.js.