bili & library bundler
https://bili.egoist.sh/#/#quick-start
# Node.js 8 or above:
$ npm i -D bili
# OR
$ yarn add -D bili
bundle
# Run bili in your project to bundle src/index.js in CommonJS format:
$ bili
# To bundle in other formats:
$ bili --format esm
# Or multiple
$ bili --format cjs --format esm
# And you want minified bundles?
$ bili --format esm-min --format cjs-min
configs
sourceMap
https://github.com/egoist/bili/blob/master/src/cli.ts
clear dist bug
{
.option(
'--no-map',
'Disable source maps, enabled by default for minified bundles'
)
.option('--map-exclude-sources', 'Exclude source code in source maps')
}
https://bili.egoist.sh/api/interfaces/config
https://bili.egoist.sh/#/configuration-file
bili.config.js
bili.config.ts
.bilirc.js
.bilirc.ts
https://github.com/egoist/bili/issues
plugins
https://bili.egoist.sh/#/plugins
https://rollup-plugin-vue.vuejs.org/options.html#include
// import vue from "rollup-plugin-vue";
module.exports = {
banner: true,
output: {
extractCSS: true,
},
plugins: {
vue: {
css: true
},
},
};
https://bili.egoist.sh/#/migration/v3-to-v4.md
https://bili.egoist.sh/#/recipes/vue-component
demo
https://github.com/nrifki/nice-handsome-button/issues/2
https://github.com/xgqfrms/xyz-button
bug
OK
cjs bug
bili.config.js & new version docs
https://github.com/egoist/bili/issues/194#issuecomment-495458552
{
"main": "./dist/index.js",
"scripts": {
"start": "vue serve ./src/xyz-button.vue",
"build": "bili --plugin.vue.css true",
"bili-all": "bili "src/index.js" --format cjs --plugin.vue.css true",
"bili-default": "bili",
"bili-string": "bili src/index.js --format cjs --plugin.vue.css true",
"old-build": "bili --name index --plugin vue --vue.css false",
"test": "echo "Error: no test specified" && exit 1"
},
"bin": {
"dev": "dev",
"app": "app"
},
}
module.exports = {
banner: true,
output: {
extractCSS: false,
},
plugins: {
vue: {
css: true
},
},
};
©xgqfrms 2012-2020
www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!