emotion-webpack-entrypoints-plugin

1.2.1 • Public • Published

What is this?

This is a webpack plugin that allows you to get all the entrypoints and insert them into your markup.

Instalation

npm i -D emotion-webpack-entrypoints-plugin

or

yarn add --dev emotion-webpack-entrypoints-plugin

Usage

const EntrypointsPlugin = require('emotion-webpack-entrypoints-plugin')

plugins: [
  new EntrypointsPlugin({
    dir: [folder with html],
    path: [path to your scripts]
  })
]

You must have a wrapper for scripts in HTML

HTML:
  <!-- BEGIN scripts -->
  <!-- END scripts -->

Example

webpack

const path = require('path')
const EntrypointsPlugin = require('emotion-webpack-entrypoints-plugin')

plugins: [
  new EntrypointsPlugin({
    dir: path.resolve(__dirname, 'src/templates/layouts'),
    path: './js'
  })
]

HTML input

 <!-- BEGIN scripts -->
 <!-- END scripts -->

HTML output

<!-- BEGIN scripts -->
  <script src="./js/vendors~app.js"></script> 
  <script src="./js/app.js"></script>
<!-- END scripts -->

/emotion-webpack-entrypoints-plugin/

    Package Sidebar

    Install

    npm i emotion-webpack-entrypoints-plugin

    Weekly Downloads

    0

    Version

    1.2.1

    License

    ISC

    Unpacked Size

    3.96 kB

    Total Files

    5

    Last publish

    Collaborators

    • lkosteckyi