@nativescript-community/xml-ui-loader
TypeScript icon, indicating that this package has built-in type declarations

3.3.1-alpha.3 • Public • Published

@nativescript-community/xml-ui-loader

npm npm

This loader provides support for using @nativescript-community/xml-ui-compiler in Webpack.

Installation

npm install @nativescript-community/xml-ui-loader --save-dev

Usage

webpack.config.js

const webpack = require('@nativescript/webpack');
const { getEntryDirPath, getPlatformName } = require('@nativescript/webpack/dist/helpers/platform');
const { chainLoaderConfiguration } = require("@nativescript-community/xml-ui-loader/helpers");

module.exports = (env) => {
  webpack.init(env);

  // Learn how to customize:
  // https://docs.nativescript.org/webpack

  webpack.chainWebpack((config) => {
    chainLoaderConfiguration(config, {
      appPath: getEntryDirPath(),
      platform: getPlatformName()
    });
  });

  return webpack.resolveConfig();
};

There are also few preprocessing options that are useful for applying output customizations.

chainLoaderConfiguration(config, {
  appPath: getEntryDirPath(),
  platform: getPlatformName(),
  useDataBinding: false, // Set this to false if you don't want to use data binding system
  preprocess: {
    // Format attribute value
    attributeValueFormatter: (value, attributeName, tagName, attributes) => value.toUpperCase(),
    // Manage AST result
    transformAst: (ast, generateFunc) => generateFunc(ast).code,
  }
});

Package Sidebar

Install

npm i @nativescript-community/xml-ui-loader

Weekly Downloads

1

Version

3.3.1-alpha.3

License

Apache-2.0

Unpacked Size

10.1 kB

Total Files

8

Last publish

Collaborators

  • dgmachado
  • classicoldsong
  • mayerlench
  • jcassidyav
  • sebjean
  • cjohn001
  • edusperoni
  • asharghi
  • farfromrefuge
  • triniwiz
  • eddyverbruggen
  • rigor789
  • walkerrunpdx
  • dnr
  • keerl
  • cvietor
  • bradmartin
  • rdlabo
  • tralves