0.36.0 • Published 5 years ago

@minna-ui/preprocess v0.36.0

Weekly downloads
80
License
Apache-2.0
Repository
github
Last release
5 years ago

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

0.36.1-next.57

5 years ago

0.36.0

5 years ago

0.35.2-next.58

5 years ago

0.35.2-next.35

5 years ago

0.35.2-next.30

5 years ago

0.35.2-next.31

5 years ago

0.36.0-next.24

6 years ago

0.35.0

6 years ago

0.34.0

6 years ago

0.33.0

6 years ago

0.32.0

6 years ago

0.31.0

6 years ago

0.30.0

6 years ago

0.29.0

6 years ago

0.28.0

6 years ago

0.27.0

6 years ago

0.26.0

6 years ago

0.25.0

6 years ago

0.24.0

6 years ago

0.23.0

6 years ago

0.22.2

6 years ago

0.22.1

6 years ago

0.22.1-beta.2

6 years ago

0.22.1-beta.1

6 years ago

0.22.1-beta.0

6 years ago

0.22.0-beta.0

6 years ago

0.22.0-next.23

6 years ago

0.22.0-next.20

6 years ago

0.22.0-next.12

6 years ago

0.22.0-next.332

6 years ago

0.22.0-next.331

6 years ago

0.22.0-next.325

6 years ago

0.22.0-next.307

6 years ago

0.22.0-next.298

6 years ago

0.22.0-next.288

6 years ago

0.22.0-next.274

6 years ago

0.22.0-next.266

6 years ago

0.22.0-next.265

6 years ago

0.22.0-next.262

6 years ago

0.22.0-next.260

6 years ago