mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2024-11-21 01:13:16 +08:00
fix: external fonts are not included (due to side effects https://github.com/rollup/plugins/issues/692)
This commit is contained in:
parent
203403e74d
commit
7a5e3f9bcc
8
build/clear-side-effects.js
Normal file
8
build/clear-side-effects.js
Normal file
@ -0,0 +1,8 @@
|
||||
const packageJson = require('../package.json')
|
||||
|
||||
packageJson.sideEffects = false
|
||||
|
||||
require('fs-extra').writeFileSync(
|
||||
require('path').resolve(__dirname, '..', 'package.json'),
|
||||
JSON.stringify(packageJson, 0, 2) + '\n'
|
||||
)
|
8
build/restore-side-effects.js
Normal file
8
build/restore-side-effects.js
Normal file
@ -0,0 +1,8 @@
|
||||
const packageJson = require('../package.json')
|
||||
|
||||
delete packageJson.sideEffects
|
||||
|
||||
require('fs-extra').writeFileSync(
|
||||
require('path').resolve(__dirname, '..', 'package.json'),
|
||||
JSON.stringify(packageJson, 0, 2) + '\n'
|
||||
)
|
@ -4,13 +4,12 @@
|
||||
"description": "A Vue UI Framework. Caring About Styles, Themed, Batteries Included, Not Rather Slow.",
|
||||
"main": "lib/index.js",
|
||||
"module": "es/index.js",
|
||||
"sideEffects": false,
|
||||
"scripts": {
|
||||
"start": "npm run dev",
|
||||
"deprecated:build:icons": "npm run clean && node build/build-icons.js",
|
||||
"build:js": "npm run gen-version && npm run clean && node build/before-build.js && rollup -c",
|
||||
"build:package": "npm run gen-version && npm run clean && node build/build-icons.js && node build/before-build.js && rollup -c",
|
||||
"build:site": "npm run build:package && ./build/before-build-site.sh && cross-env NODE_ENV=production NODE_OPTIONS=--max-old-space-size=4096 vite build && rm -rf node_modules/naive-ui && cp site/index.html site/404.html",
|
||||
"build:site": "npm run build:package && ./build/before-build-site.sh && node build/restore-side-effects.js && cross-env NODE_ENV=production NODE_OPTIONS=--max-old-space-size=4096 vite build && rm -rf node_modules/naive-ui && cp site/index.html site/404.html && node build/clear-side-effects.js",
|
||||
"build:doc": "npm run gen-version && npm run build && rm -rf build-doc/dist && cross-env NODE_ENV=production webpack --config build/webpack.doc.js",
|
||||
"clean": "rm -rf site lib es src-mirror node_modules/naive-ui",
|
||||
"dev": "npm run clean && npm run gen-version && cross-env NODE_ENV=development vite",
|
||||
@ -95,5 +94,6 @@
|
||||
"vooks": "^0.0.6",
|
||||
"vue": "^3.0.4",
|
||||
"vueuc": "^0.0.1"
|
||||
}
|
||||
},
|
||||
"sideEffects": false
|
||||
}
|
||||
|
2
vue3.md
2
vue3.md
@ -355,7 +355,7 @@
|
||||
- [x] chrome date-picker overflow (focus({ preventScroll }))
|
||||
- [x] slider 键盘好像会激活不该激活的 tooltip...
|
||||
- [x] transfer 打包之后有问题
|
||||
- [x] side effects = false 好像会影响 rollup 的打包(这让我很不安,要是生效 css 怎么办?要是不生效 JS 怎么办?) https://github.com/rollup/plugins/issues/692
|
||||
- [x] side effects = false 好像会影响 rollup 的打包(这让我很不安,要是生效 css 怎么办?要是不生效 JS 怎么办?)(事实上确实会影响网站对于 fonts 的打包,只能先靠脚本凑活一下) https://github.com/rollup/plugins/issues/692
|
||||
- [x] vue 在 $attrs 的处理上 dev 和 prod 还是有差别 https://github.com/vuejs/vue-next/issues/2741
|
||||
|
||||
## Info
|
||||
|
Loading…
Reference in New Issue
Block a user