login-webpack-plugin

set login info into localStorage

Usage no npm install needed!

<script type="module">
  import loginWebpackPlugin from 'https://cdn.skypack.dev/login-webpack-plugin';
</script>

README

Login Webpack Plugin

This plugin fully depends on html-webpack-Plugin

Description

store remote data in localStorage.

Install

  npm install --save-dev login-webpack-plugin

Usage

const LoginWebpackPlugin = require('login-webpack-plugin');
module.exports = {
  plugins: [
    new LoginWebpackPlugin({
      url: 'wwww.example.com/api',
      json: {
        password: '123',
        userName: 'user',
      }
    })
  ]
}

Options

Name Type Default Description
url String None api path
json Object None sets body to JSON representation of value
localStorage String 'loginInfo' localStorage key