@minna-ui/preprocess
Code transformers and svelte preprocessor for use in Minna UI projects.
Last updated 6 months ago by maxmilton .
Apache-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @minna-ui/preprocess 
SYNC missed versions from official npm registry.

NPM version Licence

@minna-ui/preprocess

Collection of Svelte preprocessors for use in Minna UI projects. It consists of a markup preprocessor which strips out excessive whitespace (collapses relevant whitespace down to a single space but leaves appropriate tags alone, e.g. <pre>, <script>, <style>) and a style preprocessor which runs styles through PostCSS.

Usage

Install:

yarn add @minna-ui/preprocess

Next add the preprocessor to your Svelte settings (e.g. in webpack.config.js or rollup.config.js).

If you want all our preprocessors use the all-in-one preset:

import { preprocess } from '@minna-ui/preprocess';

svelte({
  preprocess,
});

Or if you prefer, you can select the preprocessors individually:

import { markup, style } from '@minna-ui/preprocess';

svelte({
  preprocess: {
    markup: markup({
      // only use in production builds for better dev debugging
      enabled: process.env.NODE_ENV === 'production',
    }),
    style: style(),
  },
});

Utils

You can also strip whitespace from any HTML in a string template literal by using the html helper:

import { html } from '@minna-ui/preprocess';

const myMarkup = html`
  <div>
    <h1>My Title</h1>
  </div>
`;

console.log(myMarkup); // '<div><h1>My Title</h1></div>'

Tip: If you're using rollup with the setting treeshake.pureExternalModules = true (docs), prepend the call with a pure annotation so the module is tree shaken from the final JS bundle:

/*#__PURE__*/html`...`; // eslint-disable-line

Licence

@minna-ui/preprocess is part of Minna UI, an Apache-2.0 licensed open source project. See LICENCE.


© 2020 We Are Genki

Current Tags

  • 0.22.1-beta.2                                ...           beta (a year ago)
  • 0.36.0                                ...           latest (6 months ago)
  • 0.36.1-next.57                                ...           next (4 months ago)

40 Versions

  • 0.36.1-next.57                                ...           4 months ago
  • 0.36.0                                ...           6 months ago
  • 0.35.2-next.58                                ...           8 months ago
  • 0.35.2-next.35                                ...           9 months ago
  • 0.35.2-next.31                                ...           9 months ago
  • 0.35.2-next.30                                ...           9 months ago
  • 0.36.0-next.24                                ...           10 months ago
  • 0.35.0                                ...           10 months ago
  • 0.34.0                                ...           a year ago
  • 0.33.0                                ...           a year ago
  • 0.32.0                                ...           a year ago
  • 0.31.0                                ...           a year ago
  • 0.30.0                                ...           a year ago
  • 0.29.0                                ...           a year ago
  • 0.28.0                                ...           a year ago
  • 0.27.0                                ...           a year ago
  • 0.26.0                                ...           a year ago
  • 0.25.0                                ...           a year ago
  • 0.24.0                                ...           a year ago
  • 0.23.0                                ...           a year ago
  • 0.22.2                                ...           a year ago
  • 0.22.1                                ...           a year ago
  • 0.22.1-beta.2                                ...           a year ago
  • 0.22.1-beta.1                                ...           a year ago
  • 0.22.1-beta.0                                ...           a year ago
  • 0.22.0-beta.0                                ...           a year ago
  • 0.22.0-next.23                                ...           a year ago
  • 0.22.0-next.20                                ...           a year ago
  • 0.22.0-next.12                                ...           a year ago
  • 0.22.0-next.332                                ...           a year ago
  • 0.22.0-next.331                                ...           a year ago
  • 0.22.0-next.325                                ...           a year ago
  • 0.22.0-next.307                                ...           a year ago
  • 0.22.0-next.298                                ...           a year ago
  • 0.22.0-next.288                                ...           a year ago
  • 0.22.0-next.274                                ...           a year ago
  • 0.22.0-next.266                                ...           a year ago
  • 0.22.0-next.265                                ...           a year ago
  • 0.22.0-next.262                                ...           a year ago
  • 0.22.0-next.260                                ...           a year ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (3)
Dev Dependencies (1)

Copyright 2014 - 2016 © taobao.org |