Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
babel-plugin-transform-nej-module
Advanced tools
使用webpack打包nej。通过本插件,可以将nej的依赖管理系统转换为标准AMD格式,使得webpack能够对它进行打包。
npm install --save-dev babel-plugin-transform-nej-module
;{
test: /\.js$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: 'babel-loader',
options: {
presets: [],
plugins: ['babel-plugin-transform-nej-module']
}
}
},
webpack.config.js
中增加路径配置,根据nej所在位置、代码使用的别名进行调整;{
resolve: {
alias: {
'base': path.resolve(__dirname, 'lib/nej/src/base'),
'platform': path.resolve(__dirname, 'lib/nej/src/base/platform')
}
}
}
nej-polyfill
webpack配置示例如下:
const path = require('path');
const resolve =path.resolve;
module.exports = {
resolve: {
alias: {
'pro': path.resolve(__dirname, 'src/javascript'),
'pool': path.resolve(__dirname, 'lib'),
'base': path.resolve(__dirname, 'lib/nej/src/base'),
'platform': path.resolve(__dirname, 'lib/nej/src/base/platform')
}
},
module: {
rules: [
{
test: /\.js$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-es2015'],
plugins: ["transform-remove-strict-mode", 'babel-plugin-transform-nej-module']
}
}
},
{
test: /\.css$/,
exclude: /(node_modules|bower_components)/,
use: ['style-loader', 'css-loader']
},
{
test: /\.(html)$/,
use: {
loader: 'html-loader',
options: {
attrs: [':data-src']
}
}
}
]
}
}
FAQs
transform nej module to require
The npm package babel-plugin-transform-nej-module receives a total of 8 weekly downloads. As such, babel-plugin-transform-nej-module popularity was classified as not popular.
We found that babel-plugin-transform-nej-module demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.