Security News
New Python Packaging Proposal Aims to Solve Phantom Dependency Problem with SBOMs
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools oft miss.
Webpack scaffolding, hot-dev-server, build.
Do not need to understand webpack, only need to know how to configure it to use, get rid of cumbersome duplication of webpack configuration.
此处有中文文档
ES6
vue2.0
, support react
hey.conf.js
configuration filenpm install -g hey-cli
# new version npm
sudo npm install -g hey-cli --unsafe-perm=true --allow-root
Add the hey.conf.js configuration file in the project root directory.
module.exports = {
"port": 9002, //Port
"dist": 'dist', //the root of the build file
"clean": true, //clean dist folder before build
"timestamp": false, //the static folder generated by build with the static[timestamp] named folder
"react": true, //support react project
"openBrowser": true, // open browser auto
"stat": true, // Whether to generate stat.json
"webpack": { //webpack related configuration
"console": false, //package compression whether to retain the console, the default is false
"publicPath": "/", //public path
"compress": true / false, // default value depends on build or dev, or you can set compress js when build.
"output": {
// Output what documents, mainly html,
// Default setting will load the same js file as the html file name for the entrance.
// Support for defining common packages.
"./*.html": {
// Load js file by default, and html automatically references.
//If not configured, the same js file as the html file name is automatically
"entry":"./src/index.js"
}
},
//define resolve, https://webpack.js.org/configuration/resolve/
"alias": {
components: './src/components/',
// You can use import index from 'components/index' => src/components/index
},
//define global, https://webpack.js.org/plugins/provide-plugin
"global": {
"Vue": "vue",
"$": "jquery",
"log": "./js/common/log",
// use export default
Utils: [path.resolve(__dirname, 'src/js/common/utils'), 'default'],
},
//define proxy, https://webpack.js.org/configuration/dev-server/#devserver-proxy
"devServer": {
"proxy": {
"/api": {
"target": "http://yoda:9000"
}
},
historyApiFallback: true
},
//define externals, https://webpack.js.org/configuration/externals/
"externals":{
},
//Define the global less parameter definition, you can use the globalVars parameter in any less
globalVars: './static/css/var.less',
},
// The files that are not referenced are copied to the packaged folder when build
"copy": [
"./images/**/*",
"./help/**/*",
"./template/**/*"
]
};
You can expand and configure the following properties in the webpack configuration item in hey.conf.js:
Specific use, please refer to webpack document.
"hey": {
"port": 9008,
"timestamp": true,
"dist": "gen",
"webpack": {
"publicPath": "/",
"output": {
"./*.html": {
"entry":"./src/app"
}
},
"global": {
"Vue": "vue"
},
"devServer": {
"historyApiFallback":true
}
}
}
"hey": {
"port": 9008,
"timestamp": true,
"dist": "gen",
"webpack": {
"publicPath": "/",
"output": {
"./*.html": {
"entry":"src/app"
}
},
"global": {
"Vue": "vue"
},
"devServer": {
"historyApiFallback":true
},
"externals": {
"Vue": "window.Vue",
"VueRouter": "window.VueRouter"
}
}
}
Mainly used to build some of the common code, simple configuration can be used.
Because it is a public package packaged into UMD mode, do not use the import mode.
module.exports = {
dist: "build",
webpack: {
umd: {
entry: "./src/index.js",
library: "Validator",
filename: 'validator.js', //build generation /build/validator.js
libraryExport: 'default'
},
externals: {
"manba": "manba" //The dependent package will not be packaged into the source code
}
}
};
Start webpack server
hey dev
hey build
# use custom config file build project
hey build -f index.esm.js
You can generate analyze.
hey dev -r
# or
hey dev --report
# after hey build
hey report
# or
hey report -p port -f dist/stat.json
//Identification is a development environment, or a production environment
const debug = process.env.NODE_ENV == 'development'; //production
Generate project using template.
hey init <project-name>
# hey init test
The current template
For specific projects, please refer to hey-cli-template。
FAQs
webpack脚手架,hot-dev-server,build
The npm package hey-cli receives a total of 44 weekly downloads. As such, hey-cli popularity was classified as not popular.
We found that hey-cli 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
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools oft miss.
Security News
Socket CEO Feross Aboukhadijeh discusses open source security challenges, including zero-day attacks and supply chain risks, on the Cyber Security Council podcast.
Security News
Research
Socket researchers uncover how threat actors weaponize Out-of-Band Application Security Testing (OAST) techniques across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.