同步操作将从 Gitee 极速下载/Simplepack 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
Make pack more simple than ever, base on Webpack (version 3+)
Webpack is a good tool, but it need a complex config file to do the build.
simplepack
want to let you drop the complex config file, use single line command (or minimal config file) to finish the job.
simplepack
have lots of loaders and plugins builtin, you can build these extensions directly
.jsx
.vue
(with ES6+ support).js
(with ES6+ support).less
or .css
(extract css to single file).json
.txt
# global install
npm install -g simplepack
# or you need to admin auth.
sudo npm install -g simplepack
# dev: start a dev server, build and serve file in memory
simplepack dev --entry ./index.js
# publush: build and export file to ./dist folder
simplepack publish --entry ./index.js
Both dev and publish command has the same options
╭∩╮(︶︿︶)╭∩╮: simplepack -h
[Simplepack]: Start parse config file...
Usage: simplepack [options] [command]
Commands:
dev, d Start dev server for develop
help Display help
publish, p get dist. file for publish
Options:
-C, --cli-only Use CLI config only, not merge config file (disabled by default)
-C, --compress Whether compress the output code
-c, --config Specifies a different configuration file to pick up
-E, --engine [value] The name of workflow engine (defaults to "webpack")
-e, --entry The list entries
-E, --export The name of Component export
-E, --extract-css Whether extract css file from bundle (disabled by default)
-h, --help Output usage information
-n, --not-clear Do not clear the output dir
-v, --version Output the version number
Description | Type | Default | |
---|---|---|---|
entry | The list entries | String / Object | null |
compress | Whether uglify the output code | Boolean | false |
export | The name of Component export (commonly use to expose a library with UMD) | String | null |
cli-only | Use CLI config only, not merge config file | Boolean | false |
Most like Webpack config option.entry
, but extend the glob ablity
{
// simple
// './test/a.js' => './dist/test/a.js'
entry: './test/a.js'
// simple with glob: expand to multi entry
// './test/(a,b,c...).js' => './dist/test/(a,b,c...).js'
entry: './test/*.js'
// complex
entry: {
// './test/a.js' => './dist/a-new.js'
'a-new': './test/a.js',
// special @multi key, same as `simple with glob`
'@multi': './test/*.js',
// special @vendor key, specific the third party lib.
// vendor will pack to a single file, instead of pack into other bundle
// jquery+loadsh => './dist/vendor.js'
'@vendor': [
'jquery',
'lodash'
]
}
}
Other notice:
Complex entry support array
in object value, it indicate you want multi file to build in one entry
vendor.js
need to manualy import to your project, use <script>
tag, more detail
After install you can pack in any project, just need single line command.
simplepack dev --entry './index.js' --compress --export 'AComponent'
Put a js file to your project root, named simplepack.config.js
{
entry: {
index: './index.js'
},
compress: true,
export: 'AComponent'
}
Full config support, please see here
MIT
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。