parcel-transformer-inline-source

1.0.9 • Public • Published

parcel-transformer-inline-source

Parcel v2 plugin for an inline any type of files into a html, css and even js files.

Install

npm i parcel-transformer-inline-source --save-dev

Add to .parcelrc

{
  "transformers": { "*": ["...", "parcel-transformer-inline-source"] }
}

How it works

Source:

<!-- index.html -->
Inline script to html
<script>
    <!--=> include("index.js"); -->
</script>

Include other html 
<!--=> include("footer.html"); -->
/* style.css */

/*=> include("someOtherStyles.css"); */
// index.js

// include other js file into current file
/*=> include("other.js"); */

// load file to string 
let code = `/*=> include("../../../../modules/snackbar/index.js"); */`;

Package Sidebar

Install

npm i parcel-transformer-inline-source

Weekly Downloads

2

Version

1.0.9

License

MIT

Unpacked Size

3.98 kB

Total Files

4

Last publish

Collaborators

  • sanstv