1.0.0-rc.3 • Published 6 years ago

prajna-wrapper-plugin v1.0.0-rc.3

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

prajna-wrapper-plugin

Usage

Import prajna-wrapper-plugin in your webpack.config.js

const PrajnaWrapperPlugin = require('prajna-wrapper-plugin');
// ...
plugins: [
    // ...
    new PrajnaWrapperPlugin({
        includes: ['./templates/index.html'],
        options: {
            autopv: true,    // send pageview requests automaticlly
            env: 'dev',
            project: 'your-project-name',
            prajnaServerUrls: {
                'dev': 'http://dev-server-url.com/to/process/prajna/requests',
                'beta': 'http://beta-server-url.com/to/process/prajna/requests',
                'product': 'http://production-server-url.com/to/process/prajna/requests',
            }
        }
    }),
]

Configurations

KeyValueRequiredDescription
includesstringhtml or template files you want to inject prajna code to
options.autopvbooleansend pageview request automaticlly or not: true, false, default is false
options.envstringapplication environment: dev, test, alpha, beta, release-candidate, product, default is dev
options.projectstringapplication name
options.prajnaServerUrlsobjectkey value mapping between environment and server url for handling prajna requests: {"dev": "https://example.com/api/prajna"}
options.progressive.crossoriginbooleanadd crossorigin attribute for resources on the html or template file
options.progressive.scriptPathstringyour prajna cdn url, default is test here!