我with rollup在我的SQL查询中使用.我没有获得汇总的别名.
我的SQL是
SELECT [Column1],
sum([Column2])
FROM Tablea
GROUP BY [Column2] WITH ROLLUP
Run Code Online (Sandbox Code Playgroud)
哪个回报
s 8
t 8
j 8
null 24
Run Code Online (Sandbox Code Playgroud)
如何更换NULL总排?
我想将从 node_modules 导入的所有模块作为外部模块。这个的配置是什么?
我尝试过但没有成功:
import path from "path";
import glob from "glob";
import multiEntry from "rollup-plugin-multi-entry";
export default {
entry: "src/**/*.js",
format: "cjs",
plugins: [
multiEntry()
],
external: glob.sync("node_modules/**/*.js").map(file => path.resolve(file)),
dest: "dist/bundle.js"
}];
Run Code Online (Sandbox Code Playgroud)
或者
import multiEntry from "rollup-plugin-multi-entry";
export default {
entry: "src/**/*.js",
format: "cjs",
plugins: [
multiEntry()
],
external: id => id.indexOf("node_modules") !== -1,
dest: "dist/bundle.js"
}];
Run Code Online (Sandbox Code Playgroud) 我正在编写一个带有 typescript、sass 和 rollup 的 react 组件库,我希望它尽可能独立。
有没有人对如何最好地包含 scss 文件中引用的资产(图像和字体)有任何建议?
一种解决方案可能是某种加载程序(例如 postcss 处理器),用 base64 版本替换 scss 文件中引用的所有图像和字体资产。
有没有人有一个例子可以有效地做到这一点?任何解决方案或建议将不胜感激
我的汇总配置如下所示:
import peerDepsExternal from "rollup-plugin-peer-deps-external";
import resolve from "rollup-plugin-node-resolve";
import typescript from "rollup-plugin-typescript2";
import scss from 'rollup-plugin-scss'
import sass from "rollup-plugin-sass";
import commonjs from "rollup-plugin-commonjs";
import copy from "rollup-plugin-copy";
import url from '@rollup/plugin-url';
import packageJson from "./package.json";
export default {
input: "src/index.tsx",
output: [
{
file: packageJson.main,
format: "cjs",
sourcemap: true
},
{
file: packageJson.module,
format: "esm",
sourcemap: true
}
],
plugins: …Run Code Online (Sandbox Code Playgroud) 我正在使用 rollup 来构建我的 TypeScript 源代码。我只想删除注释,而不进行任何缩小,以便在调试时热更新代码。
我已经尝试过rollup-plugin-terser,它可以删除注释,但它也会以某种方式缩小我的代码,我无法完全禁用缩小。
我怎样才能做到这一点?谢谢!
我想问我是否应该如何解决这个问题,因为我已经对这部分感到困惑和困惑。我已经使用此命令全局安装了 rollup
npm install --global rollup
Run Code Online (Sandbox Code Playgroud)
但是,当我尝试运行“rollup”命令时,我应该期望汇总信息或某些内容会显示在我的 CLI 中吗?但我的 CLI 显示
“rollup”不被识别为内部或外部命令、可操作程序或批处理文件。
到目前为止我所做的是。
我已经阅读了一些文档,但问题仍然存在。https://github.com/Esri/ago-assistant/issues/176
请赐教。谢谢
javascript rollup command-line-interface node.js ecmascript-6
我有一个使用 Vite 编译和捆绑的基于 TypeScript 的 Vuejs 项目。
我正在尝试配置构建系统来编译我的自定义服务工作线程 (src/service-worker.ts) 并将输出放置在 dist/service-worker.js 中。特别是,我不希望将其作为应用程序 JS 包的一部分包含在内,因为它需要作为静态网站的一部分在该众所周知的 URL 上提供服务。
现有的结构是这样的:
index.html
public/
favicon.ico
src/
service-worker.ts
main.ts
/* etc */
Run Code Online (Sandbox Code Playgroud)
我希望输出是这样的:
dist/
index.html
assets/index.[hash].js
assets/vendor.[hash].js
/* ... */
service-worker.js # <-- I would like the file emitted here
Run Code Online (Sandbox Code Playgroud)
如果服务工作线程不需要被转译/编译,我知道我可以简单地将它包含在其中public/,并将其复制到dist/原封不动地复制到文件夹中。
我看过vite-plugin-pwa但它相当不透明并且与工作箱相关。
其他相关问题涉及人们想要完全排除文件的情况情况,这并不是我所追求的。
如何编译 TypeScript 文件,但将其输出未捆绑在我的 dist 文件夹中?
我使用创建了一个新的 Vue 应用程序npm create vue。在运行时,该应用程序会获取配置并从中读取字符串。该字符串表示要在应用程序内呈现的组件的名称。这些动态组件位于“可插入”目录中
.\n\xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 src\n \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 App.vue\n \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 pluggables\n \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 ThisFoo.vue\n \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 ThatBar.vue\nRun Code Online (Sandbox Code Playgroud)\n所以基本上 App.vue 文件的作用是
\n<script setup lang="ts">\nimport { onMounted, shallowRef, defineAsyncComponent } from "vue";\n\nconst pluggableComponent = shallowRef();\n\nonMounted(() => {\n // fetch configuration\n const componentName = "ThisFoo"; // extract from configuration\n\n pluggableComponent.value = defineAsyncComponent(() => import(`./pluggables/${componentName}.vue`));\n});\n</script>\n\n<template>\n <div>Pluggable below:</div>\n <component :is="pluggableComponent" />\n</template>\nRun Code Online (Sandbox Code Playgroud)\n我可以在构建时访问配置文件,并知道运行时需要哪些组件,以及根据此配置将哪些组件视为“死代码”。有没有办法告诉 Vite 从构建中排除未使用的组件?
\n例如,排除整个可插拔目录,但包括可插拔目录中所需的组件
\n\n\nvite build --exclude ./src/pluggables/** --include ./src/pluggables/ThisFoo.vue
\n
或者通过创建自定义 Vite 构建函数,我可以在 CI/CD 期间调用并传入组件名称数组。 …
我目前正在使用Rollup和PostCSS。如何定位我想要处理的特定 scss 文件,而不必使用 @import 'source/scss/main.scss' in mysource/js/entry.js`
例如做类似的事情......
// rollup.config.js
...
postcss({
from: 'source/scss/main.scss'
minimize: true,
sourceMap: true,
extract : 'build/css/main.css'
}),
...
Run Code Online (Sandbox Code Playgroud)
而不是在 source/js/entry.js
//source/js/entry.js
import '../scss/main.scss'; // don't want to import SCSS from within JS file
import { someJSmodule } from './someJSmodule.js';
import { anotherJSmodule } from './anotherJSmodule.js';
Run Code Online (Sandbox Code Playgroud)
这是我的当前 rollup.config.js
// rollup.config.js
import babel from 'rollup-plugin-babel';
import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import copy from 'rollup-plugin-copy';
import postcss from 'rollup-plugin-postcss';
export …Run Code Online (Sandbox Code Playgroud) I tried to create a shared component using a storybook with react-redux. I am using rollup to create a shared component. due to some error unable to create the shared component. package.json
{
"name": "story1",
"version": "0.1.0",
"private": false,
"main": "./build/index.js",
"module": "./build/index.es.js",
"peerDependencies": {
"react": "^17.0.1",
"react-dom": "^17.0.1"
},
"dependencies": {
"@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^11.1.0",
"@testing-library/user-event": "^12.1.10",
"@types/jest": "^26.0.15",
"@types/node": "^12.0.0",
"@types/react": "^16.9.53",
"@types/react-dom": "^16.9.8",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-scripts": "4.0.1",
"rollup": "2.30",
"typescript": "^4.0.3",
"web-vitals": "^0.2.4"
},
"scripts": …Run Code Online (Sandbox Code Playgroud) output我的只有一项rollup.config.js:
export default {
input: './src/Index.tsx',
output: {
dir: './myBundle/bundle',
format: 'iife',
sourcemap: true,
},
plugins: [
typescript(),
nodeResolve(),
commonjs(),
babel(),
json(),
terser(),
],
};
Run Code Online (Sandbox Code Playgroud)
为什么 Rollup 指责我进行代码分割?
[!] Error: UMD and IIFE output formats are not supported for code-splitting builds.
rollup ×10
typescript ×4
javascript ×3
node.js ×2
postcss ×2
vite ×2
ecmascript-6 ×1
iife ×1
module ×1
reactjs ×1
rollupjs ×1
sql ×1
storyboard ×1
storybook ×1
t-sql ×1
vue.js ×1
vuejs3 ×1
webpack ×1