1.2.1 • Published 4 years ago

emotion-webpack-entrypoints-plugin v1.2.1

Weekly downloads
1
License
ISC
Repository
github
Last release
4 years ago

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 -->
1.2.1

4 years ago

1.2.0

4 years ago

1.1.0

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago