0.2.0 • Published 4 years ago

@mixspa/webpack-plugin v0.2.0

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

mixspa-webpack-plugin

Mixspa-Webpack-Plugin is a plugin for generate app info

Current Status:

NPM Version NPM Downloads Build Status

NPM

What it come from?

Pleas reference here: mixspa-core

Install

  npm i --save-dev @mixspa/webpack-plugin
  yarn add --dev @mixspa/webpack-plugin

Usage this plugin in webpack config

This plugin will generate an app info file for you that includes app basic info and assets. Just add the plugin to your webpack config as follows:

webpack.config.js

const MixspaWebpackPlugin = require('@mixspa/webpack-plugin')

module.exports = {
  entry: 'index.js',
  output: {
    path: __dirname + '/dist',
    filename: 'bundle.js'
  },
  plugins: [
    new MixspaWebpackPlugin({
      id: 'mixspa-id',
      tag: 'mixspa-tag',
      filename: 'app.json',
      publicUrl: 'http://www.example.com/dev/'
    })
  ]
}

This will generate a file dist/app.json as follows:

{
  "id": "mixspa-id",
  "tag": "mixspa-tag",
  "assets": ["http://www.example.com/dev/bundle.js"]
}

Options

You can pass the configuration options with the following values:

NameTypeDefaultDescription
idStringapp-idThe id to use for unique id for this mixspa
tagStringapp-tagThe tag to use for render this mixspa in html file
fileNameStringapp.jsonThe file include all inforamtion of this mixspa
publicUrlString''The base url for this mixspa assets published to

License

mixspa-webpack-plugin is released under the MIT license.