New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

spm-loader

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

spm-loader

auto create traceless goldlog

latest
Source
npmnpm
Version
1.0.6
Version published
Maintainers
1
Created
Source

SPM Loader

Note: based on alibaba aplus data framework, only support aplus traceless goldlog, and is strongly dependent on React !!

npm npmdown builds cover

Install

npm install --save-dev spm-loader

Usage

Configuration (use it combined with babel-loader)

module.exports = {
	module: {
    	rules: [{
        	test: /.\jsx?$/,
            use: [
            	'babel-loader',
                'spm-loader?goldlog=/aliyun&context=spm_self&key=spmKey'
            ]
        }]
    }
}

Use in module

The loader just replace the attribute spm-auto-click to standard traceless goldlog, for example data-spm-click="gostr=/aliyun;locaid=d1".

To verify locaid is unique, we compose it using three components, the filename, the module key and the iteration sequence.

So, our final locaid would be locaid=d{filename}{key}{seq}. See more in our examples.

<div spm-auto-click /> // => <div data-spm-click="gostr=/aliyun;locaid=d{filename}{key||''}" />
<div spm-auto-click={1}> // => <div data-spm-click="gostr=/aliyun;locaid=d{filename}{key||''}1" />

Options

goldlog

Traceless goldlog key. You should apply it in the spm center, start with /, default is /aliyun.

context

In jsx, we use context as the context of any iteration, so we can get properties in iteration, default is spm_self.

key

A module can be used many times in a parent module, but the traceless goldlog key must be unique, so key is used to identity a module, default is spmKey.

License

spm-loader is released under the [MIT License](http://opensource.org/licenses/MIT) .

Keywords

webpack

FAQs

Package last updated on 16 Apr 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts