1.0.2 • Published 1 year ago

babel-plugin-transform-liquid-import-to-string v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

babel-plugin-transform-liquid-import-to-string

Turn liquid imports (and export from) into strings.

Example

Given the following example.liquid.

<h1>Hello {{ user.name }}</h1>

in

import liquid from './example.liquid';

out

const liquid = '<h1>Hello {{ user.name }}</h1>';

if using export

in

export * as liquid from './example.liquid';

out

const liquid = "<h1>Hello {{ user.name }}</h1>";
export { liquid };

and if using vite style qualifiers

in

export * as liquid from './example.liquid?raw';

out

const liquid = "<h1>Hello {{ user.name }}</h1>";
export { liquid };

Installation

$ npm install babel-plugin-transform-liquid-import-to-string

Usage

Via .babelrc (Recommended)

.babelrc

{
  "plugins": ["transform-liquid-import-to-string"]
}

Via CLI

$ babel --plugins transform-liquid-import-to-string script.js

Via Node API

require("babel-core").transform("code", {
  plugins: ["transform-liquid-import-to-string"]
});
1.0.2

1 year ago

1.0.1

1 year ago